The /ifaction command works kind of like the /execute command, but it only does something if an entity/player does a specific action. the /ifaction command would be extremely useful to make challenges with only one command block, which would need entire datapacks otherwise. an example for the /ifaction command would be:
/ifaction @a jump run spreadplayers ~ ~ 0 1000 false @p
This command would whenever a player jumps, teleport this player to a random location. Some ideas for actions that could be detected would be:
jump, sneak, mine, attack, eat, get_hurt, use(right click abilities like tilling the ground or using ender eyes),use_block(like opening chest, using crafting tables etc.), kill, breed(only for animals), drop, pick_up, walk, sprint, get_advancement(you could also specify which advancement)
Thats some of my ideas. You can take some away or add some more if you think they fit, thats just a prototype
I also think that the /ifaction command would greatly fit with the "?" integer. basically what "?" does, is that it takes something random from all possible things that could be done(for example entitys that could be spawned with /summon) and does that. With both those two commands u could do so much more, especially for challenges. an example:
/ifaction @a mine run summon ? ~ ~ ~
This command would summon a random entity whenever a player breaks a block which is also a cool and complicated to program challenge. I will explain the "?" integer further in another post
Please sign in to leave a comment.
2 Comments