#This requires Skript-Mirror.... for some reason the falling blocks DO NOT hurt players, so this makes sure to hurt them.
#If you dont want to use Skript-mirror remove lines 4-7 and 18
effect make %entities% hurt entities:
trigger:
loop expressions 1:
loop-value.setHurtEntities(true);
#Functions for Gravify and Chain reactions
function gravify(b: block):
wait 1 tick
set {_b2} to block 10 above {_b}
loop blocks between {_b} and {_b2}:
if loop-block is any log block:
set {_block} to loop-block
spawn falling block of {_block} at location 0.5 below loop-block
set loop-block to air
make the last spawned entity hurt entities
wait 2 ticks
function chain(b: block, n: number):
wait 1 tick
if {_n} is less than 20:
add 1 to {_n}
loop blocks in radius 2 around {_b}:
if loop-block is any log block:
if block below loop-block is air or any leaves:
set block below loop-block to air
chain(loop-block,{_n})
gravify(loop-block)
wait 1 tick
#when a player breaks any log block block, it'll check for logs around it, and make them GRAVIFY
on break:
if gamemode of player is survival:
if event-block is any log block:
chain(event-block, 0)