I am making a gen server from scratch and need help saving a list of locations to a YAML file because everytime I restart the server it no longer will let you pick up the gen. If there's an easier method than a YAML file please do that. Thanks!
Code:
on place:
if name of player's held item is "&e&lCOAL GEN":
add location of event-block to {placed::gens::*}
send "&aYou Have Placed Down A Coal Gen!" to the player
on left click:
if event-block is coal block:
if {placed::gens::*} contains location of event-block:
cancel event
set event-block to air
remove location of event-block from {placed::gens::*}
give player glowing coal block named "&e&lCOAL GEN" with lore "&7Output: &aCoal" and "&7Upgrade Price: &a$2,500"
send "&aYou Have Picked Up A Coal Gen!" to the player
every 5 seconds:
loop all players:
loop all blocks in radius 30 of loop-player:
if loop-block is coal block:
if {placed::gens::*} contains location of loop-value-2:
drop 1 coal at block above loop-value-2