Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-177151

commands in scheduled functions that take longer than 1 tick are interrupted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2
    • None
    • Windows 10, Java version is "1.8.0_201"
    • Plausible
    • (Unassigned)

      Trying to spawn loot in a function that takes a bit to spawn (exploration maps).

      When running the function directly, I get the specified loot (rather quickly, probably within a few ticks).

      When scheduling the function, I instead sometimes get a weird map that can spawn more maps when right clicked. I believe this is because the map was not generated within 1 tick.

      Easiest way to reproduce is with endcity maps in the end with the following function:

      loot give @s loot halemaster:explore/map_endcity

       
      And loot table:

      {
          "type": "minecraft:generic",
          "pools": [
            {
              "rolls": 1,
              "entries": [
                {
                  "type": "minecraft:item",
                  "name": "minecraft:map",
                  "weight": 5,
                  "functions": [
                      {
                          "function": "minecraft:exploration_map",
                          "destination": "EndCity",
                          "decoration": "target_x",
                          "zoom": 1,
                          "skip_existing_chunks": false
                      },
                      {
                          "function": "minecraft:set_nbt",
                          "tag": "{\"display\": {\"MapColor\": 16711935},\"to_explore_map\": map_endcity}"
                      },
                      {
                          "function": "minecraft:set_name",
                          "name": "End City Explorer Map"
                      }
                  ]
                }
              ]
            }
          ]
      }

      And then you can do the following:

      /function <funcName>

      and

      /schedule function <funcName> 1s

            Unassigned Unassigned
            halemaster Christopher Hale
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: