Having difficulty making a variable go up when a certain mob is killed.

Started by oaepeep on

Topic category: Help with modding (Java Edition)

Last seen on 06:58, 24. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Having difficulty making a variable go up when a certain mob is killed.

Hello! This is my first time posting on the forum, but it's because I'm having some real difficulty with a mod of mine. You see, I have this variable, that every time a player kills a villager with an item from the tag "Ax", for the variable to go up by one. 

However, the procedure I have made doesn't seem to be working, but I don't know why. Could anyone please let me know what's going wrong here? I've checked both the tag and the registry name, and they're both correct, I'm not sure what's going wrong here.

Please let me know if you can see something wrong in this procedure! I feel like I'm losing my mind trying to figure out what's not clicking, haha.

Last seen on 15:53, 19. Jul 2024
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The trigger "entity dies"…
Fri, 06/14/2024 - 23:38

The trigger "entity dies" only checks for the entity that dies. You should use the one that triggers before of when an entity is killed, because that one also includes information about the... let's call them murderer.

Last seen on 06:58, 24. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried that, couldn't find…
Tue, 06/18/2024 - 01:04

I tried that, couldn't find a "before entity dies" trigger so I just used a "before entity is hurt" trigger. Still not working, and I'm still not quite sure why.