Hello. I have been attempting to create a Sugar Cane Gen, in which on place of a dirt block, the skript will create layers of sugar cane and dirt on top of each other. The difficulty I am having, is that the purpose of the lines.
if block loop-number above event-block is air:
if block loop-number + 1 above event-block is air:
if block loop-number + 2 above event-block is air:
if block loop-number + 3 above event-block is air:
are to make the skript stop when the gen hits any block other than air. The problem is that this skript is just going through the block and generating more layers above the block.
What it does - https://gyazo.com/d2d848d14bbacca43c17750ecbaa2ddd
What it should do - https://gyazo.com/85af677bfd423407441f7857838b5aaf
if block loop-number above event-block is air:
if block loop-number + 1 above event-block is air:
if block loop-number + 2 above event-block is air:
if block loop-number + 3 above event-block is air:
are to make the skript stop when the gen hits any block other than air. The problem is that this skript is just going through the block and generating more layers above the block.
What it does - https://gyazo.com/d2d848d14bbacca43c17750ecbaa2ddd
What it should do - https://gyazo.com/85af677bfd423407441f7857838b5aaf
Code:
on place:
if name of held item is "&e&l*&f&l* &e&lCANE &F&LGEN &e&l*&f&l*":
wait 1 second
if event-block is dirt:
loop 20 times:
if block loop-number above event-block's y-coordinate is more than 254:
stop loop
else:
if event-block is dirt:
if block loop-number above event-block is air:
if block loop-number + 1 above event-block is air:
if block loop-number + 2 above event-block is air:
if block loop-number + 3 above event-block is air:
set block loop-number above event-block to sugar cane
set block loop-number + 1 above event-block to air
set block loop-number + 2 above event-block to air
set block loop-number + 3 above event-block to dirt
wait 1 second
else:
send "1" to player
stop loop
else:
send "2" to player
stop loop
else:
send "3" to player
stop loop
else:
send "4" to player
stop loop
else:
send "&8&l[&7&lF&c&lR&8&l] &aCane Gen &7Stopped!" to player
stop loop
else:
send "&8&l[&7&lF&c&lR&8&l] &cCactus Gens &7Only Work In &cYour &7Faction's Land!" to player
Last edited: