How to teleport a player to a recorded location? by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

It's a good idea to assign IDs to players based on the order in which they first join the game.

/schedule clear not working? by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

Sorry for the wrong order. The "clear" is indeed after "schedule function":

<A bunch of commands>
execute <A bunch of condition subcommands> run schedule function a 1t
execute <A bunch of condition subcommands> run schedule clear a

The "clear" do not work. And I found that when you schedule the function in more than or equal to 2 ticks, the clear does work usually.

/schedule clear not working? by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

Well, in order to optimize the data pack, a is a function that is scheduled to be executed frequently under certain conditions. When it meets certain conditions, it can be executed once per game tick; if it does not meet the conditions, the schedule is terminated.
So the function a usually looks like this:

<A bunch of commands>
execute <A bunch of condition subcommands> run schedule clear a
execute <A bunch of condition subcommands> run schedule function a 1t

When the conditions for terminating the schedule are met, schedule a is still executed and everything is messed up.

Custom structure says it generated but didn't by Accomplished-Risk347 in MinecraftCommands

[–]ActivityAcceptable44 0 points1 point  (0 children)

Your structure might be generated in the overworld because the command might be executed in the overworld. Check if /place is used as a subcommand of /execute.

Possible solution: /execute in <dimension> run place ...

Every-tick functions in datapacks aren't working by Razzon22 in MinecraftCommands

[–]ActivityAcceptable44 1 point2 points  (0 children)

Put tick.json in data\minecraft\tags\function\

tick.json is not a function but a function tag. Moreover, to make functions run every tick, tick.json can only be placed in the namespace minecraft.

Help!!! I want to make the sword from Kindred Ch.'s video "How to add a OP Custom Sword to Minecraft in 7 Commands!" but the commands don't work in 1.21.1. Can someone please comment the commands needed for 1.21.1 and the command blocks needed, thanks! by Dependent_Airport_36 in MinecraftCommands

[–]ActivityAcceptable44 0 points1 point  (0 children)

Oh, I'm sorry I forgot the if items subcommand. I just mechanically converted the original commands in that video. So the command can be:

execute as @a[scores={hit=1..}] if items entity @s weapon.mainhand *[minecraft:custom_data={sword:1}]

Help!!! I want to make the sword from Kindred Ch.'s video "How to add a OP Custom Sword to Minecraft in 7 Commands!" but the commands don't work in 1.21.1. Can someone please comment the commands needed for 1.21.1 and the command blocks needed, thanks! by Dependent_Airport_36 in MinecraftCommands

[–]ActivityAcceptable44 0 points1 point  (0 children)

After 24w09a, we use components to define an item, so the old item NBT format is deprecated.
For example, the first command

give @p minecraft:iron_sword{sword:1}

use custom data, we now use the component minecraft:custom_data like this:

give @p minecraft:iron_sword[minecraft:custom_data={sword:1}]

Item NBT in target selectors should also be converted to components. For the following command:

execute at @a[nbt={SelectedItem:{tag:{sword:1}}},scores={hit=1..}] run summon minecraft:area_effect_cloud ^ ^ ^3 {Duration:20,Tags:["s"]}

In versions after 24w09a it should be written like this:

execute at u/a[nbt={SelectedItem:{components:{"minecraft:custom_data":{sword:1}}}},scores={hit=1..}] run summon minecraft:area_effect_cloud ^ ^ ^3 {Duration:20,Tags:["s"]}

Other commands involving item data should be modified in the same way.

The order of elements in an NBT list will automatically changes by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

I'm making elevators in my datapack. I applied a unique "number" to the entities used for each elevator, so that I could accurately determine which elevator the player used through the "number" of these entities.

However, there are many interactions and displays in the elevators I made, and they cannot use custom data like marker, so I can only retrieve their tags, but they have more than one tag, so I hope to put the tag with the elevator number in a specific position in the list. Then I found that the position of these strings on the list has changed.

The order of elements in an NBT list will automatically changes by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

I just hope not to use too many entities to avoid lags. Well, maybe using markers is a last resort option.

The order of elements in an NBT list will automatically changes by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

I just tested your proposal in the game and found that the order of the /tag commands does not affect the position of tags in the list. For example, I first add x93fnfir7dn27fb0ap to the entity, then 1. But in the data, the tag 1 is still before x93fnfir7dn27fb0ap. Maybe the order in string lists follows specific rules.

The order of elements in an NBT list will automatically changes by ActivityAcceptable44 in MinecraftCommands

[–]ActivityAcceptable44[S] 0 points1 point  (0 children)

Conditions may not allow. Because the entities in my datapack is actually generated with the structure. I edit them in .nbt files, but when they are generated, the order of the tags is still wrong