Started by
modbroz
on
Topic category: Help with Minecraft modding (Java Edition)
How would I make a single entity spawn when the current entity is looked at and basically replace the old entity with the newly spawned one? I was able to make an entity despawn when looked at but when I try to do the same thing but with spawning an entity it spawns like millions of the entity I want to spawn and I only want one entity to spawn when the current entity is looked at. Anyone able to help out will be appreciated a ton, thanks!
Edited by modbroz on Tue, 10/28/2025 - 21:43
Please someone help I have limited time to make this thing so I would apricate it so much if someone could help me out
Add a synced data to the original entity and set the data to logic for example entitydespawn and false and take you're already made procedure to set the entitydespawn to true. Now go to the entity tick update (the original entity) set when get synced data of entity and name of the synced data = entitydespawn if true then despawn event targets entity and spawn at xyz your new entity