Started by
RandomDrago
on
Topic category: Help with Minecraft modding (Java Edition)
Hoi! I've been planning on making a map and the map will have respawning custom mobs at a certain village when they die.
So I want the mob to respawn after getting killed.
And if it's possible I want there to be a limit to how many of them can exist at the same time (only 7 alive at same time for example)
Would appreciate it if someone helped about this
It actually isn't too hard to do this. So for your custom village, when it spawns, you have to make 3 global map variables: villagexpos, villageypos, villagezpos do the procedure:
When structure spawns:
Set villagexpos to x
Set villageypos to y
Set villagezpos to z
And now, in an "when entity dies" global procedure, add this:
If event/target entity is sub-type of your custom entity:
Do in server-side world "The dimension your custom village spawns in"
spawn entity at villagexpos villageypos+3 villagezpos Type: Your custom entity
Or something like that.
Ooh! That's pretty clever thank you for your help! I couldn't think of doing that lmao :D