Topic category: Help with modding (Java Edition)
So i'm making a "hallucination" event and the way i'm doing this is with invisible entities. When you touch them, it triggers the event, and the entity despawns. But often times the event will overlap because the entity dosen't despawn in time and it happens every frame, causing awkward jumpscares. Here's what i've tried:
- Making a player lifetime variable so that only the last overlap appears, didn't work.
- Despawning the entity before the event happens, didn't work.
So how do i make this event happen only once? i'm not experienced with code, so procedures only would be preferable.
Edit: This problem was solved by making it so the hallucinations happen on an attack, so this is no longer relevant.