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

NBT target selector argument is very poorly optimized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 18w05a
    • None
    • OS: Windows 10
      Java: 1.8u161
    • Unconfirmed

      I have been messing around with the new NBT target selector, and I noticed this in the built-in debugger:

      [00] commandFunctions - 18.26%/18.26%
      [01] |   minecraft:tick - 99.53%/18.18%
      [02] |   |   execute as @e[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{Unbreakable:1b,Damage:2}}}] run tag @s add tc_wrench_hold - 26.63%/4.84%
      

      If you look at the performance usage, it seems quite high (26.63%/4.84%!) compared to this example:

      [02] |   |   execute as @s[tag=tc_wrench_canuse] at @s[tag=tc_wrench_canuse] if block ~ ~ ~ minecraft:piston[facing=up] run function techcraft:wrench/actions/rotate_piston_0 - 0.90%/0.16%
      

            Unassigned Unassigned
            daknus iLiquid
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: