Started by
Lambda System
on
Topic category: Help with Minecraft modding (Java Edition)
I'll keep it short
I'm wondering if it's possible to switch the target entity of a procedure to a DIFFERENT entity. Like- For example: Say if the player right clicks the entity while holding Pink Dye, it'll spawn a different entity and then despawn the other one that came before it. Does the target entity automatically switch to the new one? Or do I have to tell the procedure "hey this new entity is now the event/target entity"? And if that is possible, how do i go about into doing that?
Help would be really appreciated :]
Edited by Lambda System on Tue, 06/27/2023 - 20:18
I'm pretty sure the target entity still refers to the previous (now despawned or killed) entity. You can still do things with the nonexistent entity, but the entity is gone from the world, and when the procedure ends the entity will be deleted.
The variable name for the target entity is just
entity
, so you can switch the target entity simply by making your own entity variable and then using this custom code snippet (it's under Advanced):Now, all future "Event/target entity" blocks will refer to the entity stored in "myEntityVariableName".
ooohh i see, thank you :]