Do statement local variable restriction workaround

Started by SamIsCool213 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do statement local variable restriction workaround

I'm making a "Gate" block where custom illagers deal damage to it to try to break through. "Damage" is stored in a local variable inside an on block tick update where the block checks for illagers around it then it SHOULD damage itself accordingly. Since there will be multiple gate blocks, I can't just switch it to a global.  I LITTERALLY JUST NEED IT TO RETAIN THAT NUMBER INSIDE THE BLOCK FOR 15 TICKS IS THERE A WAY TO STORE A NUMBER ON A BLOCK!?

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use an integer custom…
Tue, 06/24/2025 - 01:32

use an integer custom property in the "block states" tab of the block