Procedure for player collision happening twice?

Started by choclo234 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure for player collision happening twice?
Sun, 08/07/2022 - 21:37 (edited)

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.

Edited by choclo234 on Sun, 08/07/2022 - 21:37