[BUG] Conflicts With Vanilla Commands
Phoupraw opened this issue ยท 2 comments
In vanilla, runing the following commands in sequence
summon minecraft:experience_orb ~ ~ ~ {Tags:['test_orb']}
execute as @e[type=minecraft:experience_orb,tag=test_orb] run data modify entity @s Value set value 100s
will summon a experience orb which gives player 100 xp.
But if this mod is installed, the above commands will summon a experience orb which gives player only 0 xp.
I guess that the new type of experience orb entity reads vanilla NBT only when initializing, but not when any other NBT changes.
Well firstly, the orb is replaced (killed) with a custom entity when it joins the world, so in this case your entity selector is wrong (it is no longer that entity type).
Secondly, we don't read the nbt, we get the value from the entity object itself before we kill it.
And finally, just spawn the orb with the data the first time around, that would solve the issue and probably be better for server tps, instead of running 2 commands.
There isn't anything I could even do to fix this, at the end of the day, that second command is just wrong for the mod.
Well firstly, the orb is replaced (killed) with a custom entity when it joins the world, so in this case your entity selector is wrong (it is no longer that entity type).
Secondly, we don't read the nbt, we get the value from the entity object itself before we kill it.
And finally, just spawn the orb with the data the first time around, that would solve the issue and probably be better for server tps, instead of running 2 commands.
There isn't anything I could even do to fix this, at the end of the day, that second command is just wrong for the mod.
Oh, because vanilla mod (datapack) isn't able to specify the NBT dynamically in summon command, it has to use data command or execute store command to specify it. In this case, merging orbs function of carpet mod is more compitable.