GRIZDOR

make me this skript into a plugin

📎 1 file 49,122 chars
📄
pasted-code-1788615107952.txt
txt 1202 lines
▶
on load:
    if {lobby} is not set:
        set {lobby} to spawn of world("world")
    if {winningPlatform} is not set:
        set {winningPlatform} to location(0, 64, 0, world("world"))
    if {spectatorPodium} is not set:
        set {spectatorPodium} to location(10, 64, 10, world("world"))
    set {tier::F} to "&8[&7F&8]"
    set {tier::D} to "&8[&2D&8]"
    set {tier::C} to "&8[&aC&8]"
    set {tier::B} to "&8[&eB&8]"
    set {tier::A} to "&8[&6A&8]"
    set {tier::S} to "&8[&cS&8]"
    set {tier::VIP} to "&e[&dVIP&e]"
    set {tierOrder::1} to "UNRANKED"
    set {tierOrder::2} to "F"
    set {tierOrder::3} to "D"
    set {tierOrder::4} to "C"
    set {tierOrder::5} to "B"
    set {tierOrder::6} to "A"
    set {tierOrder::7} to "S"
    set {tierOrder::8} to "VIP"
    set {colours::1} to "Green"
    set {colours::2} to "Blue"
    set {colours::3} to "Red"
    set {colours::4} to "Orange"
    set {colours::5} to "Yellow"
    set {colours::6} to "Purple"
    set {colours::7} to "Pink"
    set {colours::8} to "Brown"
    set {colourCode::Green} to "&a"
    set {colourCode::Blue} to "&9"
    set {colourCode::Red} to "&c"
    set {colourCode::Orange} to "&6"
    set {colourCode::Yellow} to "&e"
    set {colourCode::Purple} to "&5"
    set {colourCode::Pink} to "&d"
    set {colourCode::Brown} to "&6"

on join:
    updatePlayerDisplay(player)
    if {gameRunning} is not true:
        teleport player to {lobby}

on respawn:
    teleport player to {lobby}

on drop:
    if world of player is "world":
        if player is not op:
            cancel event

on pick up:
    if world of player is "world":
        if player is not op:
            cancel event

on place:
    if world of player is "world":
        if player is not op:
            cancel event

on break:
    if world of player is "world":
        if player is not op:
            cancel event

on damage:
    if victim is a player:
        if world of victim is "world":
            cancel event

on hunger meter change:
    if world of player is "world":
        cancel event

every 2 seconds:
    loop all players:
        if world of loop-player is "world":
            set loop-player's food level to 10
            
            if loop-player is not op:
                if gamemode of loop-player is not survival:
                    set gamemode of loop-player to survival
                    
            if y-coordinate of loop-player <= 0:
                teleport loop-player to {lobby}
                send "&cYou were teleported to the lobby because you fell out of the world." to loop-player

command /axospec:
    permission: op
    trigger:
        spawn an axolotl at player's location
        set {_axo} to last spawned entity
        set name of {_axo} to "&6Spectate Round"
        execute console command "data merge entity %uuid of {_axo}% {NoAI:1b,Invulnerable:1b}"
        send "&aSpectator axolotl spawned!" to player

on right click on entity:
    if type of event-entity is axolotl:
        if name of event-entity is "&6Spectate Round":
            cancel event
            if {gameRunning} is true:
                teleport player to location(0, 200, 0, {gameWorld})
                set gamemode of player to spectator
                send "&aYou are now spectating the match." to player
            else:
                send "&cThere is no active FFA game to spectate." to player

on damage:
    if victim is an axolotl:
        if name of victim is "&6Spectate Round":
            cancel event

function updatePlayerDisplay(p: player):
    set {_tier} to {tier::%{_p}%}
    set {_colour} to {teamcolour::%{_p}%}
    set {_prefix} to ""
    set {_colourCode} to "&f"
    
    if {_tier} is set:
        set {_prefix} to "%{tier::%{_tier}%}% "
        
    if {_colour} is set:
        set {_colourCode} to {colourCode::%{_colour}%}
        
    set {_name} to name of {_p}
    set {_formattedName} to "%{_prefix}%%{_colourCode}%%{_name}%&r"
    
    set display name of {_p} to {_formattedName}
    set tab list name of {_p} to {_formattedName}
    
    execute console command "tab player %{_p}% tabprefix ""%{_prefix}%%{_colourCode}%"""
    execute console command "tab player %{_p}% tagprefix ""%{_prefix}%%{_colourCode}%"""

on chat:
    set {_tier} to {tier::%player%}
    set {_colour} to {teamcolour::%player%}
    set {_prefix} to ""
    if {_tier} is set:
        set {_prefix} to "%{tier::%{_tier}%}% "
    set {_name} to name of player
    set {_colourCode} to "&f"
    if {_colour} is set:
        set {_colourCode} to {colourCode::%{_colour}%}
    set the chat format to "%{_prefix}%%{_colourCode}%%{_name}%&7: &f%message%"

on tab complete of "/tier":
    set tab completions for position 1 to all players
    set tab completions for position 2 to "set" and "remove"
    if tab arg-2 is "set":
        set tab completions for position 3 to "F", "D", "C", "B", "A", "S", and "VIP"

command /tier   []:
    permission: op
    permission message: &cYou don't have permission.
    executable by: players
    trigger:
        if argument 2 is "remove":
            delete {tier::%argument 1%}
            updatePlayerDisplay(argument 1)
            send "&aRemoved tier from %argument 1%" to player
            stop
        if argument 2 is not "set":
            send "&cUsage: /tier  set  or /tier  remove" to player
            stop
        set {_tier} to argument 3
        set {_valid} to false
        set {_validTiers::*} to "F", "D", "C", "B", "A", "S", and "VIP"
        loop {_validTiers::*}:
            if {_tier} is loop-value:
                set {_valid} to true
                exit loop
        if {_valid} is false:
            send "&cInvalid tier. Valid: F, D, C, B, A, S, VIP" to player
            stop
        set {tier::%argument 1%} to {_tier}
        updatePlayerDisplay(argument 1)
        send "&aSet tier of %argument 1% to %{_tier}%" to player

on tab complete of "/removeall":
    set tab completions for position 1 to "tier", "teamcolour", and "tabdata"

command /removeall :
    permission: op
    trigger:
        if argument 1 is "tier":
            loop all players:
                delete {tier::%loop-player%}
                updatePlayerDisplay(loop-player)
            send "&aRemoved all tiers." to player
        else if argument 1 is "teamcolour":
            loop all players:
                delete {teamcolour::%loop-player%}
                updatePlayerDisplay(loop-player)
            send "&aRemoved all team colours." to player
        else if argument 1 is "tabdata":
            loop all players:
                execute console command "tab player %loop-player% remove"
            send "&aCleared all saved TAB player data." to player
        else:
            send "&cUsage: /removeall tier, /removeall teamcolour, or /removeall tabdata" to player

on tab complete of "/teamcolour":
    set tab completions for position 1 to all players
    set tab completions for position 2 to "set" and "remove"
    if tab arg-2 is "set":
        set tab completions for position 3 to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"

command /teamcolour   []:
    permission: op
    executable by: players
    trigger:
        if argument 2 is "remove":
            delete {teamcolour::%argument 1%}
            updatePlayerDisplay(argument 1)
            send "&aRemoved team colour from %argument 1%" to player
            stop
        if argument 2 is not "set":
            send "&cUsage: /teamcolour  set  or /teamcolour  remove" to player
            stop
        set {_col} to argument 3
        set {_valid} to false
        set {_validColours::*} to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"
        loop {_validColours::*}:
            if {_col} is loop-value:
                set {_valid} to true
                exit loop
        if {_valid} is false:
            send "&cInvalid colour. Valid: Green, Blue, Red, Orange, Yellow, Purple, Pink, Brown" to player
            stop
        set {teamcolour::%argument 1%} to {_col}
        updatePlayerDisplay(argument 1)
        send "&aSet team colour of %argument 1% to %{_col}%" to player

command /tiergui:
    permission: op
    executable by: players
    trigger:
        openTiersGUI(player)

function openTiersGUI(p: player):
    set {_gui} to chest inventory with 6 rows named "&6Tiers Management"
    set {_allPlayers::*} to all players
    if {guiPage::%{_p}%} is not set:
        set {guiPage::%{_p}%} to 1
    set {_page} to {guiPage::%{_p}%}
    set {_start} to ({_page} - 1) * 45
    set {_end} to {_start} + 44
    set {_endPlusOne} to {_end} + 1
    set {_slot} to 0
    set {_i} to 0
    loop {_allPlayers::*}:
        set {_pl} to loop-value
        add 1 to {_i}
        if {_i} > {_start}:
            if {_i} <= {_endPlusOne}:
                set {_item} to {_pl}'s skull
                set name of {_item} to "&a%{_pl}%"
                set lore of {_item} to "&7Tier: &f%{tier::%{_pl}%}%", "&7Colour: &f%{teamcolour::%{_pl}%}%", "", "&eRMB: &fToggle Tier", and "&eShift+RMB: &fToggle Colour"
                set slot {_slot} of {_gui} to {_item}
                set {guiPlayer::%{_p}%::%{_slot}%} to {_pl}
                add 1 to {_slot}
    if {_page} > 1:
        set slot 45 of {_gui} to red dye named "&cPrevious Page"
    if {_end} < size of {_allPlayers::*} - 1:
        set slot 53 of {_gui} to lime dye named "&aNext Page"
    set slot 49 of {_gui} to barrier named "&cClose"
    open {_gui} to {_p}

on inventory click:
    if name of event-inventory is "&6Tiers Management":
        cancel event
        set {_slot} to index of event-slot
        if {_slot} is 45:
            if {guiPage::%player%} > 1:
                subtract 1 from {guiPage::%player%}
                openTiersGUI(player)
            stop
        if {_slot} is 53:
            add 1 to {guiPage::%player%}
            openTiersGUI(player)
            stop
        if {_slot} is 49:
            close player's inventory
            stop
        set {_p} to {guiPlayer::%player%::%{_slot}%}
        if {_p} is set:
            set {_c} to "%click type%"
            if {_c} contains "shift":
                if {_c} contains "right":
                    set {_currentCol} to {teamcolour::%{_p}%}
                    set {_colList::*} to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"
                    set {_index} to 0
                    if {_currentCol} is set:
                        loop {_colList::*}:
                            if loop-value is {_currentCol}:
                                set {_index} to loop-index parsed as integer
                                exit loop
                    set {_nextIndex} to {_index} + 1
                    if {_nextIndex} > size of {_colList::*}:
                        delete {teamcolour::%{_p}%}
                    else:
                        set {teamcolour::%{_p}%} to {_colList::%{_nextIndex}%}
                    updatePlayerDisplay({_p})
                    openTiersGUI(player)
            else if {_c} contains "right":
                set {_current} to {tier::%{_p}%}
                if {_current} is not set:
                    set {_current} to "UNRANKED"
                set {_index} to 1
                loop {tierOrder::*}:
                    if loop-value is {_current}:
                        set {_index} to loop-index parsed as integer
                        exit loop
                set {_nextIndex} to {_index} + 1
                if {_nextIndex} > size of {tierOrder::*}:
                    set {_nextIndex} to 1
                set {_newTier} to {tierOrder::%{_nextIndex}%}
                if {_newTier} is "UNRANKED":
                    delete {tier::%{_p}%}
                else:
                    set {tier::%{_p}%} to {_newTier}
                updatePlayerDisplay({_p})
                openTiersGUI(player)

command /setsellingstation :
    permission: op
    trigger:
        if argument 1 is between 1 and 8:
            set {sellingStations::%argument 1%} to player's location
            send "&aSet selling station %argument 1% to your location." to player
        else:
            send "&cNumber must be 1-8." to player

command /setbuyerstation :
    permission: op
    trigger:
        if argument 1 is between 1 and 8:
            set {buyerStations::%argument 1%} to player's location
            send "&aSet buyer station %argument 1% to your location." to player
        else:
            send "&cNumber must be 1-8." to player

on tab complete of "/setcaptain":
    set tab completions for position 1 to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"
    set tab completions for position 2 to all players

command /setcaptain  :
    permission: op
    trigger:
        set {_col} to argument 1
        set {_valid} to false
        set {_validColours::*} to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"
        loop {_validColours::*}:
            if {_col} is loop-value:
                set {_valid} to true
                exit loop
        if {_valid} is false:
            send "&cInvalid colour. Valid: Green, Blue, Red, Orange, Yellow, Purple, Pink, Brown" to player
            stop
        set {captains::%{_col}%} to argument 2
        set {teamcolour::%argument 2%} to {_col}
        updatePlayerDisplay(argument 2)
        send "&aSet %argument 2% as captain of %{_col}% and added them to the team." to player

command /resetpoints:
    permission: op
    trigger:
        loop all players:
            set {points::%loop-player%} to 600
        send "&aReset all players' points to 600." to player

on tab complete of "/setpoints":
    set tab completions for position 1 to all players

command /setpoints  :
    permission: op
    trigger:
        set {points::%argument 1%} to argument 2
        send "&aSet %argument 1%'s points to %argument 2%." to player

on tab complete of "/startbid":
    set tab completions for position 1 to "F", "D", "C", "B", and "A"

command /startbid :
    permission: op
    trigger:
        if {bidPhase} is "bidding":
            send "&cA bid is already in progress." to player
            stop
        set {_tier} to argument 1
        set {_valid} to false
        set {_validTiers::*} to "F", "D", "C", "B", and "A"
        loop {_validTiers::*}:
            if {_tier} is loop-value:
                set {_valid} to true
                exit loop
        if {_valid} is false:
            send "&cCan only bid for F, D, C, B, A tiers." to player
            stop

        loop {colours::*}:
            set {_col} to loop-value
            if {captains::%{_col}%} is not set:
                loop all players:
                    set {_loopPlayer} to loop-value-2
                    set {_pTier} to {tier::%{_loopPlayer}%}
                    if {_pTier} is "S":
                        set {_isAlreadyCaptain} to false
                        loop {colours::*}:
                            set {_checkCol} to loop-value-3
                            if {captains::%{_checkCol}%} is {_loopPlayer}:
                                set {_isAlreadyCaptain} to true
                                exit loop
                        if {_isAlreadyCaptain} is false:
                            set {captains::%{_col}%} to {_loopPlayer}
                            set {teamcolour::%{_loopPlayer}%} to {_col}
                            updatePlayerDisplay({_loopPlayer})
                            broadcast "&aAutomatically assigned %{_loopPlayer}% as captain of %{_col}% (S-Tier)."
                            exit loop

        set {_players::*} to all players
        delete {_eligible::*}
        loop {_players::*}:
            set {_pTier} to {tier::%loop-value%}
            if {_pTier} is {_tier}:
                add loop-value to {_eligible::*}
        if size of {_eligible::*} is 0:
            send "&cNo players of tier %{_tier}% found." to player
            stop

        delete {_teams::*}
        loop {colours::*}:
            if {captains::%loop-value%} is set:
                add loop-value to {_teams::*}
        if size of {_teams::*} is 0:
            send "&cNo captains set. Use /setcaptain or have S-tier players online." to player
            stop

        set {bidPlayers::*} to {_eligible::*}
        set {bidTeams::*} to {_teams::*}
        set {bidTier} to {_tier}
        set {bidPhase} to "bidding"
        delete {bidBids::*}
        delete {bidOrder::*}
        set {bidCounter} to 0

        set {_i} to 1
        loop {bidPlayers::*}:
            if {_i} > 8:
                set {_i} to 1
            if {sellingStations::%{_i}%} is set:
                teleport loop-value to {sellingStations::%{_i}%}
            add 1 to {_i}
        set {_i} to 1
        loop {bidTeams::*}:
            if {_i} > 8:
                set {_i} to 1
            if {buyerStations::%{_i}%} is set:
                teleport {captains::%loop-value%} to {buyerStations::%{_i}%}
            add 1 to {_i}

        loop {bidPlayers::*}:
            set {freeze::%loop-value%} to true

        broadcast "&eBidding for ALL players of tier &6%{_tier}%&e has started! You have 60 seconds."
        broadcast "&eCaptains can bid using /bid  "

        wait 30 seconds
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 30 seconds!"
        wait 20 seconds
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 10 seconds!"
        wait 5 seconds
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 5 seconds!"
        wait 1 second
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 4 seconds!"
        wait 1 second
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 3 seconds!"
        wait 1 second
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 2 seconds!"
        wait 1 second
        if {bidPhase} is "bidding":
            broadcast "&eBidding ends in 1 second!"
        wait 1 second

        if {bidPhase} is "bidding":
            loop {bidPlayers::*}:
                set {_targetPlayer} to loop-value
                set {_highestBid} to 0
                clear {_winningCaptain}
                clear {_winningColour}
                set {_earliestOrder} to 999999

                loop {colours::*}:
                    set {_col} to loop-value-2
                    set {_cap} to {captains::%{_col}%}
                    if {_cap} is set:
                        if {bidBids::%{_cap}%::%{_targetPlayer}%} is set:
                            set {_amount} to {bidBids::%{_cap}%::%{_targetPlayer}%}
                            broadcast "%{_cap}% bidded %{_amount}% for %{_targetPlayer}%"
                            
                            if {_amount} > {_highestBid}:
                                set {_highestBid} to {_amount}
                                set {_winningCaptain} to {_cap}
                                set {_winningColour} to {_col}
                                set {_earliestOrder} to {bidOrder::%{_cap}%::%{_targetPlayer}%}
                            else if {_amount} is {_highestBid}:
                                if {bidOrder::%{_cap}%::%{_targetPlayer}%} < {_earliestOrder}:
                                    set {_winningCaptain} to {_cap}
                                    set {_winningColour} to {_col}
                                    set {_earliestOrder} to {bidOrder::%{_cap}%::%{_targetPlayer}%}

                if {_winningCaptain} is set:
                    set {teamcolour::%{_targetPlayer}%} to {_winningColour}
                    updatePlayerDisplay({_targetPlayer})
                    subtract {_highestBid} from {points::%{_winningCaptain}%}
                    broadcast "%{_targetPlayer}% goes to Team %{_winningColour}% for %{_highestBid}%"
                else:
                    broadcast "%{_targetPlayer}% went unsold."

            set {bidPhase} to "idle"
            delete {bidBids::*}
            delete {bidOrder::*}
            loop {bidPlayers::*}:
                delete {freeze::%loop-value%}
            broadcast "&aBidding for tier %{bidTier}% completed!"

on tab complete of "/bid":
    if {bidPhase} is "bidding":
        set tab completions for position 1 to {bidPlayers::*}

command /bid  :
    executable by: players
    trigger:
        if {bidPhase} is not "bidding":
            send "&cNo bid is currently open." to player
            stop
        set {_captainTeam} to false
        loop {colours::*}:
            if {captains::%loop-value%} is player:
                set {_captainTeam} to loop-value
                exit loop
        if {_captainTeam} is false:
            send "&cYou are not a captain." to player
            stop
            
        set {_targetPlayer} to argument 1
        set {_bidAmount} to argument 2
        
        set {_validTarget} to false
        loop {bidPlayers::*}:
            if loop-value is {_targetPlayer}:
                set {_validTarget} to true
                exit loop
        if {_validTarget} is false:
            send "&cThat player is not up for bidding in this tier." to player
            stop
            
        set {_points} to {points::%player%}
        if {_points} < {_bidAmount}:
            send "&cYou don't have enough points. You have %{_points}%." to player
            stop
            
        set {_tier} to {bidTier}
        set {_min} to 0
        set {_max} to 0
        if {_tier} is "F":
            set {_min} to 15
            set {_max} to 125
        else if {_tier} is "D":
            set {_min} to 35
            set {_max} to 175
        else if {_tier} is "C":
            set {_min} to 50
            set {_max} to 215
        else if {_tier} is "B":
            set {_min} to 75
            set {_max} to 250
        else if {_tier} is "A":
            set {_min} to 100
            set {_max} to 300
            
        if {_bidAmount} < {_min}:
            send "&cBid must be between %{_min}% and %{_max}% for tier %{_tier}%." to player
            stop
        if {_bidAmount} > {_max}:
            send "&cBid must be between %{_min}% and %{_max}% for tier %{_tier}%." to player
            stop
            
        add 1 to {bidCounter}
        set {bidBids::%player%::%{_targetPlayer}%} to {_bidAmount}
        set {bidOrder::%player%::%{_targetPlayer}%} to {bidCounter}
        send "&aYou bid %{_bidAmount}% on %{_targetPlayer}%." to player

command /endbid:
    permission: op
    trigger:
        if {bidPhase} is not "bidding":
            send "&cNo bid in progress." to player
            stop
        set {bidPhase} to "idle"
        loop {bidPlayers::*}:
            delete {freeze::%loop-value%}
        broadcast "&cBidding forcibly ended by admin."

command /kitsave :
    permission: op
    trigger:
        loop 36 times:
            set {kitInv::%argument 1%::%loop-number - 1%} to slot (loop-number - 1) of player's inventory
        set {kitArmour::%argument 1%::*} to player's armour
        set {kitOffhand::%argument 1%} to player's offhand item
        send "&aKit '%argument 1%' saved." to player

on tab complete of "/kitload":
    set tab completions for position 1 to indices of {kitArmour::*}

command /kitload :
    permission: op
    trigger:
        if {kitArmour::%argument 1%::*} is not set:
            send "&cKit '%argument 1%' does not exist." to player
            stop
        clear player's inventory
        loop 36 times:
            set slot (loop-number - 1) of player's inventory to {kitInv::%argument 1%::%loop-number - 1%}
        set player's armour to {kitArmour::%argument 1%::*}
        set player's offhand item to {kitOffhand::%argument 1%}
        send "&aKit '%argument 1%' loaded." to player

on tab complete of "/kitsdelete":
    set tab completions for position 1 to indices of {kitArmour::*}

command /kitsdelete :
    permission: op
    trigger:
        if {kitArmour::%argument 1%::*} is not set:
            send "&cKit '%argument 1%' does not exist." to player
            stop
        delete {kitInv::%argument 1%::*}
        delete {kitArmour::%argument 1%::*}
        delete {kitOffhand::%argument 1%}
        send "&aKit '%argument 1%' deleted." to player

on tab complete of "/kitgive":
    set tab completions for position 1 to all players and "everyone"
    set tab completions for position 2 to indices of {kitArmour::*}

command /kitgive  :
    permission: op
    trigger:
        set {_target} to argument 1
        set {_kitName} to argument 2
        if {kitArmour::%{_kitName}%::*} is not set:
            send "&cKit '%{_kitName}%' does not exist." to player
            stop
        if {_target} is "everyone":
            loop all players:
                clear loop-player's inventory
                loop 36 times:
                    set slot (loop-number - 1) of loop-player's inventory to {kitInv::%{_kitName}%::%loop-number - 1%}
                set loop-player's armour to {kitArmour::%{_kitName}%::*}
                set loop-player's offhand item to {kitOffhand::%{_kitName}%}
            send "&aKit '%{_kitName}%' given to everyone." to player
        else:
            set {_p} to {_target} parsed as player
            if {_p} is not set:
                send "&cPlayer not found." to player
                stop
            clear {_p}'s inventory
            loop 36 times:
                set slot (loop-number - 1) of {_p}'s inventory to {kitInv::%{_kitName}%::%loop-number - 1%}
            set {_p}'s armour to {kitArmour::%{_kitName}%::*}
            set {_p}'s offhand item to {kitOffhand::%{_kitName}%}
            send "&aKit '%{_kitName}%' given to %{_p}%." to player

on tab complete of "/smpffa":
    set tab completions for position 1 to "start"
    set tab completions for position 2 to indices of {kitArmour::*}

command /smpffa  []:
    permission: op
    trigger:
        if argument 1 is "start":
            if {gameRunning} is true:
                send "&cA game is already running." to player
                stop
            set {_kit} to argument 2
            if {kitArmour::%{_kit}%::*} is not set:
                send "&cKit '%{_kit}%' does not exist." to player
                stop
                
            set {_worldName} to "ffa_%random integer between 100000 and 999999%"
                
            broadcast "&e[SMPFFA] &aGenerating arena world... Game will start in 10 seconds!"
            execute console command "mv create %{_worldName}% normal"
            
            wait 10 seconds
            
            set {gameWorld} to world({_worldName})
            set {_loc} to location(0, 200, 0, world({_worldName}))
            
            execute console command "mv modify set pvp false %{_worldName}%"
            execute console command "mv modify set difficulty peaceful %{_worldName}%"
            execute console command "execute in %{_worldName}% run gamerule doDaylightCycle false"
            execute console command "execute in %{_worldName}% run gamerule doMobSpawning false"
            execute console command "execute in %{_worldName}% run gamerule announceAdvancements false"
            execute console command "execute in %{_worldName}% run gamerule locator_bar false"
            execute console command "execute in %{_worldName}% run gamerule pvp false"
            execute console command "execute in %{_worldName}% run worldborder set 500"
            
            loop all players:
                execute console command "mv tp %loop-player% %{_worldName}%"
                
            wait 1 tick
            
            loop all players:
                teleport loop-player to {_loc}
                set gamemode of loop-player to survival
                apply potion effect of slow falling to loop-player for 90 seconds
                clear loop-player's inventory
                loop 36 times:
                    set slot (loop-number - 1) of loop-player's inventory to {kitInv::%{_kit}%::%loop-number - 1%}
                set loop-player's armour to {kitArmour::%{_kit}%::*}
                set loop-player's offhand item to {kitOffhand::%{_kit}%}
                
            set {gameRunning} to true
            set {gameType} to "team"
            set {gameSeconds} to 0
            set {borderStage} to 0
            if {gameLoopRunning} is not true:
                set {gameLoopRunning} to true
                gameLoop()

on tab complete of "/ffa":
    set tab completions for position 1 to "start" and "win"
    if tab arg-1 is "start":
        set tab completions for position 2 to indices of {kitArmour::*}

command /ffa  [] [] [] [] []:
    permission: op
    trigger:
        if argument 1 is "start":
            if {gameRunning} is true:
                send "&cA game is already running." to player
                stop
            set {_kit} to argument 2
            if {kitArmour::%{_kit}%::*} is not set:
                send "&cKit '%{_kit}%' does not exist." to player
                stop
                
            set {_worldName} to "ffa_%random integer between 100000 and 999999%"
                
            broadcast "&e[FFA] &aGenerating solo arena world... Game will start in 10 seconds!"
            execute console command "mv create %{_worldName}% normal"
            
            wait 10 seconds
            
            set {gameWorld} to world({_worldName})
            set {_loc} to location(0, 200, 0, world({_worldName}))
            
            execute console command "mv modify set pvp false %{_worldName}%"
            execute console command "mv modify set difficulty peaceful %{_worldName}%"
            execute console command "execute in %{_worldName}% run gamerule doDaylightCycle false"
            execute console command "execute in %{_worldName}% run gamerule doMobSpawning false"
            execute console command "execute in %{_worldName}% run gamerule announceAdvancements false"
            execute console command "execute in %{_worldName}% run gamerule locator_bar false"
            execute console command "execute in %{_worldName}% run gamerule pvp false"
            execute console command "execute in %{_worldName}% run worldborder set 500"
            
            loop all players:
                execute console command "mv tp %loop-player% %{_worldName}%"
                
            wait 1 tick
            
            loop all players:
                teleport loop-player to {_loc}
                set gamemode of loop-player to survival
                apply potion effect of slow falling to loop-player for 90 seconds
                clear loop-player's inventory
                loop 36 times:
                    set slot (loop-number - 1) of loop-player's inventory to {kitInv::%{_kit}%::%loop-number - 1%}
                set loop-player's armour to {kitArmour::%{_kit}%::*}
                set loop-player's offhand item to {kitOffhand::%{_kit}%}
                
            set {gameRunning} to true
            set {gameType} to "solo"
            set {gameSeconds} to 0
            set {borderStage} to 0
            if {gameLoopRunning} is not true:
                set {gameLoopRunning} to true
                gameLoop()

        else if argument 1 is "win":
            if {gameRunning} is not true:
                send "&cNo game is running." to player
                stop
            set {gameRunning} to false
            set {endgameRunning} to false
            
            delete {_winners::*}
            if argument 2 is set:
                add (argument 2 parsed as player) to {_winners::*}
            if argument 3 is set:
                add (argument 3 parsed as player) to {_winners::*}
            if argument 4 is set:
                add (argument 4 parsed as player) to {_winners::*}
            if argument 5 is set:
                add (argument 5 parsed as player) to {_winners::*}
            if argument 6 is set:
                add (argument 6 parsed as player) to {_winners::*}
                
            set {_winnerNames} to ""
            loop {_winners::*}:
                if {_winnerNames} is "":
                    set {_winnerNames} to "%loop-value%"
                else:
                    set {_winnerNames} to "%{_winnerNames}%, %loop-value%"
                    
            broadcast "&aWinners: %{_winnerNames}%!"
            doSoloWinSequence({_winners::*})
            
            wait 6 seconds
            loop all players:
                teleport loop-player to {lobby}
                clear potion effects of loop-player
            delete {gameWorld}

function gameLoop():
    while {gameRunning} is true:
        wait 1 second
        add 1 to {gameSeconds}
        
        if {gameSeconds} >= 90:
            if {borderStage} is 0:
                execute console command "mv modify set pvp true %{gameWorld}%"
                execute console command "execute in %{gameWorld}% run gamerule pvp true"
                set {borderStage} to 1
                broadcast "&c&lGrace period ended! PvP is now enabled."
        if {gameSeconds} >= 690:
            if {borderStage} is 1:
                execute console command "execute in %{gameWorld}% run worldborder set 250 2400"
                set {borderStage} to 2
        if {gameSeconds} >= 1290:
            if {borderStage} is 2:
                execute console command "execute in %{gameWorld}% run worldborder set 100 1200"
                set {borderStage} to 3
        if {gameSeconds} >= 1590:
            if {borderStage} is 3:
                execute console command "execute in %{gameWorld}% run worldborder set 50 1200"
                set {borderStage} to 4
                startEndgame()
                
        if {gameSeconds} > 90:
            if {gameType} is "team":
                set {_teamsAlive} to 0
                delete {_lastTeam}
                delete {_aliveTeams::*}
                
                loop all players:
                    if world of loop-player is {gameWorld}:
                        if gamemode of loop-player is survival:
                            set {_currentColour} to {teamcolour::%loop-player%}
                            if {_currentColour} is set:
                                if {_aliveTeams::%{_currentColour}%} is not set:
                                    set {_aliveTeams::%{_currentColour}%} to true
                                    add 1 to {_teamsAlive}
                                    set {_lastTeam} to {_currentColour}
                                    
                if {_teamsAlive} <= 1:
                    set {gameRunning} to false
                    set {endgameRunning} to false
                    if {_lastTeam} is set:
                        broadcast "&aWinner team %{_lastTeam}%"
                        doWinSequence({_lastTeam})
                        loop all players:
                            set {_pTeam} to {teamcolour::%loop-player%}
                            if {_pTeam} is {_lastTeam}:
                                if {stats::%loop-player%::elo} is not set:
                                    set {stats::%loop-player%::elo} to 1000
                                add 30 to {stats::%loop-player%::elo}
                                if {stats::%loop-player%::wins} is not set:
                                    set {stats::%loop-player%::wins} to 0
                                add 1 to {stats::%loop-player%::wins}
                                if {stats::%loop-player%::games} is not set:
                                    set {stats::%loop-player%::games} to 0
                                add 1 to {stats::%loop-player%::games}
                            else if {_pTeam} is set:
                                if {stats::%loop-player%::elo} is not set:
                                    set {stats::%loop-player%::elo} to 1000
                                add 20 to {stats::%loop-player%::elo}
                                if {stats::%loop-player%::games} is not set:
                                    set {stats::%loop-player%::games} to 0
                                add 1 to {stats::%loop-player%::games}
                                
                    wait 6 seconds
                    loop all players:
                        teleport loop-player to {lobby}
                        clear potion effects of loop-player
                    delete {gameWorld}
                    
            else if {gameType} is "solo":
                set {_playersAlive} to 0
                delete {_lastPlayer}
                
                loop all players:
                    if world of loop-player is {gameWorld}:
                        if gamemode of loop-player is survival:
                            add 1 to {_playersAlive}
                            set {_lastPlayer} to loop-player
                            
                if {_playersAlive} <= 1:
                    set {gameRunning} to false
                    set {endgameRunning} to false
                    if {_lastPlayer} is set:
                        broadcast "&aWinner: %{_lastPlayer}%!"
                        delete {_winList::*}
                        add {_lastPlayer} to {_winList::*}
                        doSoloWinSequence({_winList::*})
                        
                        if {stats::%{_lastPlayer}%::elo} is not set:
                            set {stats::%{_lastPlayer}%::elo} to 1000
                        add 30 to {stats::%{_lastPlayer}%::elo}
                        if {stats::%{_lastPlayer}%::wins} is not set:
                            set {stats::%{_lastPlayer}%::wins} to 0
                        add 1 to {stats::%{_lastPlayer}%::wins}
                        if {stats::%{_lastPlayer}%::games} is not set:
                            set {stats::%{_lastPlayer}%::games} to 0
                        add 1 to {stats::%{_lastPlayer}%::games}
                        
                    wait 6 seconds
                    loop all players:
                        teleport loop-player to {lobby}
                        clear potion effects of loop-player
                    delete {gameWorld}
    set {gameLoopRunning} to false

function doWinSequence(team: text):
    set {_colourCode} to {colourCode::%{_team}%}
    if {_colourCode} is not set:
        set {_colourCode} to "&f"
        
    set {_c} to white
    if {_team} is "Green":
        set {_c} to green
    else if {_team} is "Blue":
        set {_c} to blue
    else if {_team} is "Red":
        set {_c} to red
    else if {_team} is "Orange":
        set {_c} to orange
    else if {_team} is "Yellow":
        set {_c} to yellow
    else if {_team} is "Purple":
        set {_c} to purple
    else if {_team} is "Pink":
        set {_c} to pink
    else if {_team} is "Brown":
        set {_c} to brown
        
    loop all players:
        if {teamcolour::%loop-player%} is {_team}:
            if {winningPlatform} is set:
                teleport loop-player to {winningPlatform}
        else:
            if {spectatorPodium} is set:
                teleport loop-player to {spectatorPodium}
                
        send title "&e&lWINNERS!!!" with subtitle "%{_colourCode}%Team %{_team}%" to loop-player for 5 seconds
        play sound "entity.player.levelup" with volume 1 and pitch 0.5 to loop-player
        play sound "entity.firework_rocket.twinkle" with volume 1 and pitch 1 to loop-player
        
    loop 5 times:
        loop all players:
            if {teamcolour::%loop-player%} is {_team}:
                launch ball firework colored {_c} at loop-player's location timed 1
        wait 1 second

function doSoloWinSequence(winners: players):
    loop all players:
        set {_isWinner} to false
        loop {_winners::*}:
            if loop-player-1 is loop-value-2:
                set {_isWinner} to true
        
        if {_isWinner} is true:
            if {winningPlatform} is set:
                teleport loop-player to {winningPlatform}
        else:
            if {spectatorPodium} is set:
                teleport loop-player to {spectatorPodium}
                
        send title "&e&lWINNER!" with subtitle "&fCongratulations!" to loop-player for 5 seconds
        play sound "entity.player.levelup" with volume 1 and pitch 0.5 to loop-player
        play sound "entity.firework_rocket.twinkle" with volume 1 and pitch 1 to loop-player
        
    loop 5 times:
        loop {_winners::*}:
            launch ball firework colored yellow at loop-value-2's location timed 1
        wait 1 second

function startEndgame():
    if {endgameRunning} is not true:
        set {endgameRunning} to true
        endgameLoop()

function endgameLoop():
    set {_tick} to 0
    set {_durabilityTick} to 0
    while {gameRunning} is true:
        if {endgameRunning} is not true:
            exit loop
        wait 1 second
        add 1 to {_tick}
        add 1 to {_durabilityTick}
        loop all players in world({gameWorld}):
            if gamemode of loop-player is survival:
                set {_y} to y-coordinate of loop-player
                if {_y} > 100:
                    damage loop-player by 1
                if {_y} < 50:
                    damage loop-player by 1
        loop all players in world({gameWorld}):
            if gamemode of loop-player is survival:
                apply potion effect of glowing to loop-player for 99999 seconds
        if {_durabilityTick} >= 5:
            set {_durabilityTick} to 0
            loop all players in world({gameWorld}):
                if gamemode of loop-player is survival:
                    set {_armour::*} to armour of loop-player
                    loop {_armour::*}:
                        set {_armourPiece} to loop-value-2
                        if {_armourPiece} is not air:
                            set durability of {_armourPiece} to (durability of {_armourPiece}) - 1
                    set {_main} to tool of loop-player
                    if {_main} is not air:
                        set durability of {_main} to (durability of {_main}) - 1
                    set {_off} to offhand item of loop-player
                    if {_off} is not air:
                        set durability of {_off} to (durability of {_off}) - 1

on tab complete of "/stats":
    set tab completions for position 1 to all offline players

command /stats []:
    executable by: players
    trigger:
        set {_p} to argument 1
        if {_p} is not set:
            set {_p} to player
        if {_p} is not set:
            send "&cPlayer not found." to player
            stop
        if {stats::%{_p}%::elo} is not set:
            set {stats::%{_p}%::elo} to 1000
        if {stats::%{_p}%::kills} is not set:
            set {stats::%{_p}%::kills} to 0
        if {stats::%{_p}%::deaths} is not set:
            set {stats::%{_p}%::deaths} to 0
        if {stats::%{_p}%::wins} is not set:
            set {stats::%{_p}%::wins} to 0
        if {stats::%{_p}%::games} is not set:
            set {stats::%{_p}%::games} to 0
        set {_elo} to {stats::%{_p}%::elo}
        set {_kills} to {stats::%{_p}%::kills}
        set {_deaths} to {stats::%{_p}%::deaths}
        set {_wins} to {stats::%{_p}%::wins}
        set {_games} to {stats::%{_p}%::games}
        set {_kd} to 0
        if {_deaths} > 0:
            set {_kd} to {_kills} / {_deaths}
        else:
            set {_kd} to {_kills}
        send "&6===== &e%{_p}%'s Stats &6=====" to player
        send "&eELO: &f%{_elo}%" to player
        send "&eKills: &f%{_kills}%" to player
        send "&eDeaths: &f%{_deaths}%" to player
        send "&eWins: &f%{_wins}%" to player
        send "&eK/D Ratio: &f%{_kd}%" to player
        send "&eGames Played: &f%{_games}%" to player

on tab complete of "/resetstats":
    set tab completions for position 1 to all offline players

command /resetstats :
    permission: op
    trigger:
        set {_p} to argument 1
        if {_p} is not set:
            send "&cPlayer not found." to player
            stop
        delete {stats::%{_p}%::elo}
        delete {stats::%{_p}%::kills}
        delete {stats::%{_p}%::deaths}
        delete {stats::%{_p}%::wins}
        delete {stats::%{_p}%::games}
        send "&aSuccessfully reset all stats for %{_p}%." to player

on death:
    set {_victim} to victim
    set {_killer} to attacker
    if world of {_victim} is {gameWorld}:
        if {_killer} is a player:
            set death message to "&cElimination! &7%{_victim}% was killed by %{_killer}%"
        else:
            set death message to "&cElimination! &7%{_victim}% died"

        if {stats::%{_victim}%::elo} is not set:
            set {stats::%{_victim}%::elo} to 1000
        subtract 20 from {stats::%{_victim}%::elo}
        if {stats::%{_victim}%::deaths} is not set:
            set {stats::%{_victim}%::deaths} to 0
        add 1 to {stats::%{_victim}%::deaths}
        if {_killer} is a player:
            if {stats::%{_killer}%::elo} is not set:
                set {stats::%{_killer}%::elo} to 1000
            add 10 to {stats::%{_killer}%::elo}
            if {stats::%{_killer}%::kills} is not set:
                set {stats::%{_killer}%::kills} to 0
            add 1 to {stats::%{_killer}%::kills}

command /forceend:
    permission: op
    trigger:
        if {gameRunning} is not true:
            send "&cNo game is running." to player
            stop
        set {gameRunning} to false
        set {endgameRunning} to false
        loop all players:
            clear potion effects of loop-player
            teleport loop-player to {lobby}
        delete {gameWorld}
        broadcast "&cGame forcibly ended by admin."

command /setlobby:
    permission: op
    trigger:
        set {lobby} to player's location
        send "&aLobby set to your location." to player

command /setwinningplatform:
    permission: op
    trigger:
        set {winningPlatform} to player's location
        send "&aWinning platform set to your location." to player
        
command /setspectatorpodium:
    permission: op
    trigger:
        set {spectatorPodium} to player's location
        send "&aSpectator podium set to your location." to player

on tab complete of "/winner":
    set tab completions for position 1 to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"

command /winner :
    permission: op
    trigger:
        set {_col} to argument 1
        set {_valid} to false
        set {_validColours::*} to "Green", "Blue", "Red", "Orange", "Yellow", "Purple", "Pink", and "Brown"
        loop {_validColours::*}:
            if {_col} is loop-value:
                set {_valid} to true
                exit loop
        if {_valid} is false:
            send "&cInvalid colour." to player
            stop
            
        doWinSequence({_col})
        wait 6 seconds
        loop all players:
            teleport loop-player to {lobby}

command /lobby:
    executable by: players
    trigger:
        teleport player to {lobby}
        send "&aYou have been teleported to the lobby." to player

command /spawn:
    trigger:
        teleport player to {lobby}
        send "&aYou have been teleported to spawn." to player

command /hub:
    trigger:
        teleport player to {lobby}
        send "&aYou have been teleported to the hub." to player

on player move:
    if {freeze::%player%} is true:
        cancel event
        send "&cYou cannot move during bidding." to player
Kodari AI
KodariSep 5 at 1:40 pm 4
FFAArenaManager
A comprehensive Minecraft plugin managing FFA and team-based arena battles. It handles lobby teleportation, world protection, tier-based player rankings with GUI management, team colour assignments, captain selection, and a bidding system for player drafts. Features include kit saving/loading, arena world generation with configurable PvP timers, shrinking world borders, endgame mechanics, spectator modes, ELO tracking, kill/death statistics, and win sequences with fireworks. Admin commands control game flow, points allocation, and player displays with custom prefixes and tab names.

I’ll create a Paper plugin that preserves the Skript’s persisted player data, tier/colour management, bidding, kits, GUI, FFA game flow, statistics, lobby protections, and administrative commands.

Created the SmpFfa Paper plugin with:

  • Tier and team-colour management with /tier, /teamcolour, /tiergui

  • Player display names, tab names, chat formatting, and optional TAB integration

  • Captain assignment, points, bidding system, stations, and automatic S-tier captain assignment

  • Kit save/load/delete/give commands

  • Solo and team FFA world generation and game flow

  • Grace period, world border stages, endgame effects, winners, and cleanup

  • Player statistics, ELO, kills, deaths, wins, games, and reset commands

  • Lobby protection, spectator axolotl, respawn handling, hunger protection, and fall recovery

  • Persistent YAML storage for players, kits, captains, locations, and settings

  • Paper build configuration with XSeries compatibility support

GRIZDOR

also can u add/setbuyingstation <colour> and not 1-8

Kodari AI
KodariSep 5 at 1:42 pm 2
  1. Update the buying-station command to accept a colour name instead of numeric 1-8.

  2. Trace the existing station storage/lookup flow and patch validation, tab completion, and any user-facing help/messages consistently.

Added /setbuyingstation <colour> with these supported colours:

Green, Blue, Red, Orange, Yellow, Purple, Pink, Brown

Also updated:

  • /setbuyerstation <colour> to use colours instead of 1-8

  • Tab completion for both buying-station commands

  • Buyer station storage and teleporting by team colour

  • Plugin command registration and plugin.yml

/setsellingstation 1-8 remains numeric.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
13 872
src/main/java/com/kodari/smpffa/SmpFfaPlugin.java
package com.kodari.smpffa;

import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class SmpFfaPlugin extends JavaPlugin {
    private PlayerData data;
    private DisplayManager display;
    private KitManager kits;
    private BiddingManager bidding;
    private GameManager games;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        data = new PlayerData(this);
        display = new DisplayManager(this, data);
        kits = new KitManager(data);
        bidding = new BiddingManager(this, data, display);
        games = new GameManager(this, data, display, kits);

        TierGui tierGui = new TierGui(data, display);
        CommandHandler commands = new CommandHandler(this, data, display, kits, bidding, games, tierGui);
        String[] commandNames = {
                "axospec", "tier", "teamcolour", "removeall", "tiergui", "setsellingstation", "setbuyerstation", "setbuyingstation",
                "setcaptain", "resetpoints", "setpoints", "startbid", "endbid", "bid", "kitsave",
                "kitload", "kitsdelete", "kitgive", "smpffa", "ffa", "stats", "resetstats", "forceend",
                "setlobby", "setwinningplatform", "setspectatorpodium", "winner", "lobby", "spawn", "hub"
        };
        for (String name : commandNames) {
            PluginCommand command = getCommand(name);
            if (command != null) {
                command.setExecutor(commands);
                command.setTabCompleter(commands);
            }
        }
        Bukkit.getPluginManager().registerEvents(new SmpFfaListener(this, data, display, bidding, games, tierGui), this);
    }

    @Override
    public void onDisable() {
        if (bidding != null) bidding.stop(false);
        if (games != null) games.forceEnd(false);
        if (data != null) data.save();
    }

    public PlayerData data() { return data; }
    public DisplayManager display() { return display; }
    public KitManager kits() { return kits; }
    public BiddingManager bidding() { return bidding; }
    public GameManager games() { return games; }
}