Jump to content

(Improved) gen skript


HiroKiros

Recommended Posts

#this is not for generic gen servers this is more catered to skygen type servers drops_time is how often the item will spawn
options:
    gens_amount_cap: 999
    drops_time: 1 seconds
command /test:
    trigger:
    if player has permission "gen.cap":
        set {gens::placed::cap::%player's uuid%} to 999
 
on join:
    if {placed::gens::amount::%player's uuid%} isn't set:
        set {placed::gens::amount::%player's uuid%} to {@gens_amount_cap}
 
on tab complete of "/gengive":
    if player has permission "gen.give":
        set tab completions for position 2 to "nether wart", "bone", "fern"
command /gengive <player> <text>:
    trigger:
        if player has permission "gen.give":
            if arg-2 is "wheat":
                gengive(arg-1, hay bale, "&eWheat Gen")
            if arg-2 is "cobblestone":
                gengive(arg-1, cobblestone, "&7Cobblestone Gen")
            if arg-2 is "coal":
                gengive(arg-1, coal block, "&8Coal Gen")
on place:
    if name of player's held item contains "Gen":
        if {placed::gens::amount::%player's uuid%} >= {gens::placed::cap::%player's uuid%}:
            cancel event
            send "&cYou have max gens down!"
            stop
        add 1 to {placed::gens::amount::%player's uuid%}
        add location of event-block to {placed::gens::%player's uuid%::*}
        send "&aYou placed your %name of player's held item%"
        remove 1 of player's held item from player
        send action bar "&a%{placed::gens::amount::%player's uuid%}%&f/&a%{gens::placed::cap::%player's uuid%}%" to player
#this is where you make/edit gens to make the gens work you must rename the block ingame you can name it whatever you want aslong as it has the word "gen" in it
every {@drops_time}:
    loop all players:
        loop {placed::gens::%loop-player's uuid%::*}:
            gensDrops(loop-value-2, nether wart) if block at loop-value-2 contains Nether Quartz Ore
            gensDrops(loop-value-2, bone) if block at loop-value-2 contains Pearlescent froglight
            gensDrops(loop-value-2, fern) if block at loop-value-2 contains yellow glazed terracotta
            gensDrops(loop-value-2, nether quartz) if block at loop-value-2 contains Chiseled quartz block
            gensDrops(loop-value-2, crimson roots) if block at loop-value-2 contains Cracked deepslate bricks
#remove space at ) :
function gensDrops(L: location, I: itemtype) : 
    drop 1 of {_I} at block above {_L} without velocity
           
       
function gengive(P: player, B: itemtype, T: text :
    give {_P} 1 of {_B} named {_T}
Edited by HiroKiros
Malfunction
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...