• Hey! Register here to create your account, engage with the community, and talk about what is new!

Spawn Entity at nearest Mob? How can i grab a players HP and put it into a variable.

mangosugarz

New member
Joined
Aug 6, 2021
Messages
10
Reaction score
0
I'm wonder how to spawn an entity such as a evoker fang at the nearest mobs loc. Idk if there is a value for that or I need something like variables. Also how can I grab a players HP to put it in a variable to display it.
 

Jimmy_The_Knight

Well-known member
Joined
Dec 28, 2020
Messages
67
Reaction score
31
For the evoker fang one: Select all mobs, then filter them by distance from the default player (put a 1 in the chest to only get the nearest mob), then spawn an evoker fang at the location of the selection.

For the player HP one: theres a game value that measures player HP, you can use it instead of a variable and its value will automatically update when a player heals/takes damage (game values are readable only, so you cannot set their values using code)
 
Top Bottom