Untitled

 avatar
unknown
plain_text
a year ago
5.0 kB
4
Indexable
on left click on wheat:
  if player is holding a hoe:
    cancel event
    set action bar of player to "&6+1 Wheat!"
    set block to air
    give 1 wheat named "&6&lWheat" with lore "&a$5!" to the player
    set durability of player's tool to (durability of player's tool + 1)
    add 01 exp to player
    set event-block to air
    wait 7 seconds
    set event-block to wheat[age=7]
	
On right click with hoe:
	if name of tool of player is "&6&lFARMING HOE":
		open virtual chest inventory with 4 rows named "&3Upgrade Hoe &7» &3%player%" to player
		format slot 0 of player with cyan glass pane named " " to be unstealable
	
command /hoe:
	cooldown: 1 hour
	cooldown message: &6&lSTARKGENS &7» &6You cant get a new hoe yet you just got one!
	cooldown bypass: op
	trigger:
		give a diamond hoe named "&6&lFARMING HOE" with lore "&e&l%player%'S HOE" to the player
		
command /sell:
    cooldown: 2 seconds
    cooldown message: &6&lSTARKGENS &7» &6You are doing this too quick!
    trigger:
	
        sell(player, wheat, 5)
        sell(player, beetroots, 15)
        sell(player, golden carrots, 30)
        sell(player, potatoes, 50)
        sell(player, bamboo, 75)
		
        add {-temp::%player%} to player's balance
        send title "&6&lSOLD" with subtitle "&fYou sold all items for &e&l$%{-temp::%player%}%"
        play sound "block.note_block.pling" with volume 2 to player
        delete {-temp::%player%}

function sell(P: player, I: itemtype, N: int):
    set {_am} to amount of {_I} in {_P}'s inventory
    set {_am} to ({_am} * {_N})
    remove all {_I} from {_P}'s inventory
    add {_am} to {-temp::%{_P}%}
	
on block interact:
    if event-block is farmland:
        cancel event
        stop
		
on block break:
	if event-block is freshly planted wheat plant:
		cancel event
		
on block break:
	if event-block is freshly planted beetroot plant:
		cancel event
		
on block break:
	if event-block is freshly planted carrot plant:
		cancel event
		
on block break:
	if event-block is freshly planted potato plant:
		cancel event
		
on citizen right click:
	NPC is named "&6&lSELL"
	player command "/sell"
	
on left click on beetroot plant:
	if player is holding a hoe:
		cancel event
		set action bar of player to "&c+1 Beetroot!"
		set block to air
		give 1 beetroot named "&c&lBeetroots" with lore "&a$15!" to the player
		set durability of player's tool to (durability of player's tool + 1)
		add 6 exp to player
		set event-block to air
		wait 7 seconds
		set event-block to beetroots[age=3]
		
on left click on carrot plant:
	if player is holding a hoe:
		cancel event
		set action bar of player to "&6+1 Carrot!"
		set block to air
		give 1 golden carrot named "&6&lCarrots" with lore "&a$30!" to the player
		set durability of player's tool to (durability of player's tool + 1)
		add 12 exp to player
		set event-block to air
		wait 7 seconds
		set event-block to carrots[age=7]
		
on left click on potato plant:
	if player is holding a hoe:
		cancel event
		set action bar of player to "&e+1 Potato!"
		set block to air
		give 1 potato named "&e&lPotatoes" with lore "&a$50!" to the player
		set durability of player's tool to (durability of player's tool + 1)
		add 15 exp to player
		set event-block to air
		wait 7 seconds
		set event-block to potatoes[age=7]
		
on left click on bamboo:
	if player is holding a hoe:
		cancel event
		set action bar of player to "&a+1 Bamboo!"
		set block to air
		give 2 bamboo named "&a&lBamboo" with lore "&a$75!" to the player
		set durability of player's tool to (durability of player's tool + 1)
		add 25 exp to player
		set event-block to air
		wait 7 seconds
		set event-block to bamboo[age=1]
		
on citizen right click:
	NPC is named "&6&lFARM"
	open virtual chest inventory with 1 rows named "&6&lFARM &7» &6%player%" to player
	format slot 3 of player with golden hoe named "&6&lHOE" to be unstealable
	format slot 5 of player with sunflower named "&6&lSELL" to be unstealable
	format slot 0 of player with yellow stained glass pane named " " to be unstealable
	format slot 1 of player with yellow stained glass pane named " " to be unstealable
	format slot 2 of player with yellow stained glass pane named " " to be unstealable
	format slot 4 of player with yellow stained glass pane named " " to be unstealable
	format slot 6 of player with yellow stained glass pane named " " to be unstealable
	format slot 7 of player with yellow stained glass pane named " " to be unstealable
	format slot 8 of player with yellow stained glass pane named " " to be unstealable
	
on inventory click:
	if inventory name of player's current inventory is "&6&lFARM &7» &6%player%":
		if clicked slot is 3:
			player command "/hoe"
			close player's inventory

on inventory click:
	if inventory name of player's current inventory is "&6&lFARM &7» &6%player%":
		if clicked slot is 5:
			player command "/sell"
			close player's inventory
Leave a Comment