The Electric Gate mod works as follows: a chain of actions from the player entering the radius to the electric shock.

Started by ivanplatonov on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The Electric Gate mod works as follows: a chain of actions from the player entering the radius to the electric shock.

Hello everyone! I've decided to make a Tesla gate mod. The logic is simple (described in points below).

Gate Block: It is placed under the floor and scans a radius of 5 blocks around itself. A continuous working sound, let's call it "idle.ogg," plays.

Activation Start: Any entity appearing within the 5-block radius activates the sequence. A charging sound, let's call it "WindUp.ogg," plays. This sound lasts about 1 second.

Electric Shock: After the "WindUp.ogg" sound finishes, the "Shock.ogg" sound is activated. At this moment, the electric shock itself occurs. BUT an entity can ONLY die within a 3-block radius from the gate block and within a height of 6 blocks from the gate block. This means if a player is within the 5-block radius, nothing will happen to them. Even if they are within the 6-block height, they will only die if they enter the death radius, which is a 3-block radius in the horizontal plane and 6 blocks in height. PLUS, at the moment of the shock, at a height of 2 blocks from the gate block, a GIF of the lightning bolts themselves should play. It will simulate the visualization of the electric discharge.

After the Shock: If the player has not left the gate block's activation zone (5 blocks) after this sequence, everything starts over until the player leaves the block's zone.

I'm asking if anyone could provide a graphical diagram of the procedures for how to implement this... I'm a beginner in this program and downloaded it just to realize this idea.

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make a procedure that sets…
Sun, 03/01/2026 - 14:17

make a procedure that sets an boolean tag like "idle" to false, plays the sound, waits until the sound is finished and sets idle to true, put this on tick update for the block, now the idle sound is done.

for the shocks, we check with the "for each entity as entity iterator between x1, y1, z1....." you can find it in world procedures, actions a bit further down. you put math +/- with a number and the x y or z block that was already in the big loop block and configure the number that is added or subtracted to your box things.

in the loops you do "if entity iterate ! no entity" and then you put in play sound charge, wait "length of charge in seconds x20" ticks and then you play the shock sound and deal damage to entity iterator.

the gif thing isnt really doable, you would need entitys or block animations for that, there are tutorials on yt for that a lot.