Block health

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

TimCom228

Member
Dec 26, 2019
31
0
6
24
I need a script:

For example, an iron block has 4 hp, if this block is detonated, it will be taken away from hp 1. If hp = 0 it will destroy

These scripts can help:

on explode:
loop exploded blocks:
loop-block is #block#
set {_e::%location of loop-value%} to true
set {_e::%location of loop-value%::*} to location of loop-value
set loop-block to air
wait 0.1 second
loop {_e::*}:
set block at {_e::%loop-index%::1} to #block#

on break of #block#:
if metadata "bhealth" of event-block is not set:
set metadata "bhealth" of event-block to 1
else:
set {_meta} to metadata "bhealth" of event-block
remove 1 from {_meta}
if {_meta} is 0:
delete metadata "bhealth" of event-block
else:
cancel event
set metadata "bhealth" of event-block to {_meta}