#1.21.20
1 messages · Page 1 of 1 (latest)
That syntax stopped working since 1.19.80.
It only works in command blocks created/edited before that update.
... And also that code is super redundant and inefficient anyways. Why are you executing them to give themselves the effect when you can just directly give them the effect?
effect @e[hasitem={location=slot.weapon.mainhand,item=mt:torchspeed}] speed 1 1 true
@turbid rover
It was a function not a command block
then check your min_engine_version in your manifest.json
If you want to convert your functions to the new execute format, then I'm glad to inform you that that's not that hard: Mostly you just have to replace execute @s ~~~ <command> with execute as @s run <command> and if the run command requires a relative location (for example particle or setblock) you can use positioned ~~~ or at @s before you do run <command>. To test for blocks (for example execute @s ~~~ detect ~~~ air me is in air!) it'd be execute as @s at @s if block ~~~ air run me is in air!.
For your command provided above it'd be execute as @e[hasitem={location=slot.weapon.offhand,item=mt:torchspeed}] run effect @s speed 1 1 true, but like Daethie said, that code is not that efficient and it'd be easier to just do what he said.
If you don't want to convert your execute command functions to the new syntax, you can set the min_engine_version in your manifest.json to a version below 1.19.70.
Here is an official guide from Microsoft Learn that introduces to the new excute syntax: https://learn.microsoft.com/en-us/minecraft/creator/documents/commandsnewexecute
I put it in a function and it crashes when I enter, I don't know why.
execute as @e[hasitem={location=slot.weapon.offhand,item=mt:torchspeed}] run event entity @s torchspeed
Ugh, does the entity have the event?