#Entity X spawns -> event Y triggers
20 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Before Id just do onEvent('EntitySpawned', event => {})
But now I cant
Cause the format changed
And now I need to know the specific event category name
And the wiki is literally empty
The event you are looking for is called:
EntityEvents.spawned(<modid:entityName>, event => {})
I recommend using ProbeJS so it shows the methods & events in VS Code
Also you don’t need the modid thing but it’s handy if you want to check for just one entity type like
minecraft:zombie
Thx
Also theres like many variants of how I could do a randomized position around the mob that just spawned where the event im calling happens, and I really dont wanna make another resource demanding script.
Which way would be most optimized?
If that is relevant (i think it is for optimization reasons), yes, the event I want to call for when EntityX spawns is the spawning of an EntityY.
What is the better way to structure the picking of a randomized block within a numerically set nearby-range area in that case?
Cause the script is going to trigger many times in short timeframes.
I really dont wanna impede performance with this.
But also like yeah this would be kinda hard to find cause fkn format updates, tysmmm
Easiest why would be to generate the coordinate by choosing a random number between -5 and 5 and then adding that to the coordinate
Thanks
That is also super helpful