Started by
CasualSuolsPlayer
on
Topic category: Help with Minecraft modding (Java Edition)
So the thing is, i want to grant the player an achievement for their first death, and i cannot find a procedure block that checks for that. Dos anyone know how to do this?
There should be a 'when entity dies' global trigger. Players are considered a type of entity, so you could check if the event/target entity is a player, and, if they are, give them the achievement. Or honestly just create a procedure with this trigger, and then just use the 'give advancement' function. Since only players can recieve advancements, and they can only recieve an advancement once, that should do it.
yes, i know, but i cant find a way to check if the target entity is a player... from what i know, there in no tag for a 'player' entity type. At least i can't find it anywhere
You don't need a tag. If you go to the 'logic' tab, at the bottom, there's a 'is entity subtype of (entity type)' function, that returns true if the provided entity matches the type. This can be used for simple comparisons, (skeleton, cow, villager, etc.), but also for more complex ones. (You can use living entity, monster entity, or player entity as well.)
...It took me an embarrassingly long amount of time to find this when I was first starting out. You gotta scroll down a bit.
Of course, entity data block put in logic : /
Thank you very much, i was checking in the wrong place :)