on place:
event-block is hay bale:
add 1 to {gens::%player%::count}
add location of event-block to {gens::%player%::locations}
set {gen::%event-block%::owner} to player
every 3 seconds:
loop all blocks in world "Plots":
loop-block is hay bale:
{gen::%loop-block%::owner} is online:
drop 1 wheat with no velocity at location above loop-block
on block damage:
event-block is hay bale:
{gen::%event-block%::owner} is player:
remove location of event-block from {gens::%player%::locations}
remove 1 from {gens::%player%::count}
set block to air
give player event-block named "&e`&6Wheat Gen&e` &7(Right Click)" lored " ||&7Place somewhere to|| &7start generating wheat!|| "
play sound "entity.block.pickup" with volume 1 and pitch 1 to player
send action bar "&7Picked up | &6Wheat Gen" to player
else:
play sound "entity.villager.no" with volume 1 and pitch 1 to player
send action bar "&eThis is not your generator!" to player
You could also make the picking up and placing into a function for having more than 1 generator on your server. Also I didn't add upgrading because I'm too lazy The upgrading should be fairly simple though. Message me on discord conner#3253 if you need any more help.