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}
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}