We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

0

New command / command or change

1 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 0
    Registered User commented
    Comment actions Permalink

    This can be done with a loot table:

    {
      "pools": [
        {
          "rolls": 1,
          "entries": [
            {
              "type": "minecraft:item",
              "name": "minecraft:diamond",
              "functions": [
                {
                  "function": "minecraft:set_count",
                  "count": {
                    "type": "minecraft:score",
                    "target": "this",
                    "score": "OBJECTIVE_NAME"
                  }
                }
              ]
            }
          ]
        }
      ]
    }

    or a macro function

    # example/function/give
    execute store result storage example:tmp score int 1 run scoreboard players get @s OBJECTIVE_NAME
    function example:_give with storage example:tmp
    # example/function/_give
    $give @s diamond $(score)