Assistance understanding tag targeting

Started by CaptainShark on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Assistance understanding tag targeting

For part of my pond mod I want to be able to disable/re-enable axolotl hunting. I have managed to work out the commands to do so and execute them via right clicking a block.
My issue is I want it to only work on axolotls with the tag "pondfish" that I made via the "get/set" custom logic NBT tag.
 

This command works but it works on 1 single axolotl and it can be any axolotl, I basically want to turn this command into the following:
works on every axolotl that has the "pondfish" tag, every other axolotl will not be changed


/execute as @p run data modify entity @e[type=axolotl,limit=1] Brain.memories."minecraft:has_hunting_cooldown".value set value 0

Mcreator verison: 2024.1

Any help would be greatly appreciated 

 

I will also add the purpose in case someone knows a better way to do this.
When in my "ponds" which are created via custom blocks axolotls get given "pondfish" as a tag. As soon as they exit a pond they get "pondfish" tag set to false.
While tagged as "pondfish" they should never hunt, when it is set to false they should go back to being able to hunt.
I also made a "waspondfish" tag which is added when first becoming a "pondfish" which never gets removed in case it is helpful for any reason when it comes to non pond axolotls.