Ghost blocks created due to constantly ticking procedure?

Started by DumbWays 15 on

Topic category: Help with modding (Java Edition)

Last seen on 17:18, 4. Jun 2024
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ghost blocks created due to constantly ticking procedure?

I've got a flashlight item in my mod. It places custom invisible light-emitting blocks every tick in a line (based on player line of sight).

I want them to immediately expire when the player turns away, but setting a procedure to despawn them after a tick when they're placed makes ghost blocks almost all the time.

I can't think of any other way to fix this. /fill won't recognize the ghost blocks. Making the light blocks despawn on update tick doesn't fix the issue either.

Can someone help me out here?

2023.3, 1.20.1