Started by
Octave_
on
Topic category: Help with Minecraft modding (Java Edition)
I have been trying to find a way to modify (specifically increase) a player variable when the player damages an entity. I have tried using the 'Entity Attacked' global trigger to increase the player variable, however that doesn't seem to work.
Any insight would be greatly appreciated!
The problem would be that by hitting an entity
and increasing the player variable,
you have selected the entity and not the player.
I don't know if there is a way to run it on behalf of the source entity.
But I give you an alternative solution
I've tried this and while it does update the player variable, another issue arises where the variable is not getting saved when I reload the world, detailed here: https://mcreator.net/forum/73577/player-variable-gui-stuck-0-when-reloa…. I appreciate the help, it's just really unfortunate that there doesn't seem to be any other way to update player variables when a player attacks an entity (perhaps that could be added in a future update "Player damages mob/entity" trigger, if Klemen is updating anymore).
Are you using the player variable, permanent?
Uso la nbt como puente para añadir valores a la variable de jugador permanente, luego coloca la nbt en 0, ya que la nbt no guarda valores permanentes