Files
trims-gui.sk
Code
1 364
trims-gui.sk
# ═══════════════════════════════════════════════════════════════
# Armor Trims GUI System
# Author: Generated
# Version: 2.0
#
# Description: Interactive GUI for applying armor trims to armor pieces
# Requirements: Minecraft 1.20+, Skript 2.8+, SkBee addon (for NBT)
# Installation: Place in plugins/Skript/scripts/ and /sk reload trims-gui
# ═══════════════════════════════════════════════════════════════
options:
prefix: &6&l[TRIMS]&r
permission: trims.use
admin-permission: trims.admin
# ═══════════════════════════════════════════════════════════════
# Main Command
# ═══════════════════════════════════════════════════════════════
command /trims [<text>]:
aliases: /trim, /armortrim
permission: {@permission}
permission message: {@prefix} &cYou don't have permission to use this!
trigger:
if arg-1 is "reload":
if player has permission "{@admin-permission}":
send "{@prefix} &aScript reloaded!"
stop
else:
send "{@prefix} &cNo permission!"
stop
openTrimsMainGUI(player)
play sound "block.note_block.pling" with volume 1 and pitch 1.5 to player
# ═══════════════════════════════════════════════════════════════
# MAIN MENU - Select Armor Piece
# ═══════════════════════════════════════════════════════════════
function openTrimsMainGUI(p: player):
open chest with 5 rows named "&8Armor Trims &7- &6Select Piece" to {_p}
# Background glass
loop 45 times:
set slot (loop-number - 1) of {_p}'s current inventory to black stained glass pane named " "
# Title/Info
set slot 4 of {_p}'s current inventory to nether star named "&6&lArmor Trims System" with lore "&7Click on any equipped armor" and "&7piece to customize it!" and "" and "&e⚡ 16 Patterns Available" and "&e💎 11 Materials Available"
# Get player's armor
set {_helmet} to {_p}'s helmet
set {_chest} to {_p}'s chestplate
set {_legs} to {_p}'s leggings
set {_boots} to {_p}'s boots
# Helmet slot (slot 12)
if {_helmet} is set:
set slot 12 of {_p}'s current inventory to {_helmet} with lore "" and "&7▸ Click to customize" and "&7▸ Pattern & Material" and "" and "&eLeft-Click to open menu"
else:
set slot 12 of {_p}'s current inventory to barrier named "&cNo Helmet" with lore "&7Equip a helmet first!"
# Chestplate slot (slot 21)
if {_chest} is set:
set slot 21 of {_p}'s current inventory to {_chest} with lore "" and "&7▸ Click to customize" and "&7▸ Pattern & Material" and "" and "&eLeft-Click to open menu"
else:
set slot 21 of {_p}'s current inventory to barrier named "&cNo Chestplate" with lore "&7Equip a chestplate first!"
# Leggings slot (slot 30)
if {_legs} is set:
set slot 30 of {_p}'s current inventory to {_legs} with lore "" and "&7▸ Click to customize" and "&7▸ Pattern & Material" and "" and "&eLeft-Click to open menu"
else:
set slot 30 of {_p}'s current inventory to barrier named "&cNo Leggings" with lore "&7Equip leggings first!"
# Boots slot (slot 32)
if {_boots} is set:
set slot 32 of {_p}'s current inventory to {_boots} with lore "" and "&7▸ Click to customize" and "&7▸ Pattern & Material" and "" and "&eLeft-Click to open menu"
else:
set slot 32 of {_p}'s current inventory to barrier named "&cNo Boots" with lore "&7Equip boots first!"
# Close button
set slot 40 of {_p}'s current inventory to oak door named "&c&lClose Menu" with lore "&7Click to exit"
# ═══════════════════════════════════════════════════════════════
# PATTERN SELECTION MENU
# ═══════════════════════════════════════════════════════════════
function openPatternGUI(p: player, armorPiece: text):
set {trim::%{_p}%::piece} to {_armorPiece}
open chest with 6 rows named "&8Armor Trims &7- &6Select Pattern" to {_p}
# Background
loop 54 times:
set slot (loop-number - 1) of {_p}'s current inventory to gray stained glass pane named " "
# All 16 patterns arranged nicely
# Row 1
set slot 10 of {_p}'s current inventory to coast armor trim smithing template named "&e&lCoast" with lore "&7A coastal design" and "" and "&aClick to select!"
set slot 11 of {_p}'s current inventory to dune armor trim smithing template named "&e&lDune" with lore "&7Desert-inspired" and "" and "&aClick to select!"
set slot 12 of {_p}'s current inventory to wayfinder armor trim smithing template named "&e&lWayfinder" with lore "&7Explorer's design" and "" and "&aClick to select!"
set slot 13 of {_p}'s current inventory to raiser armor trim smithing template named "&e&lRaiser" with lore "&7Ancient design" and "" and "&aClick to select!"
set slot 14 of {_p}'s current inventory to shaper armor trim smithing template named "&e&lShaper" with lore "&7Sculpted design" and "" and "&aClick to select!"
set slot 15 of {_p}'s current inventory to host armor trim smithing template named "&e&lHost" with lore "&7Welcoming design" and "" and "&aClick to select!"
set slot 16 of {_p}'s current inventory to ward armor trim smithing template named "&e&lWard" with lore "&7Protective design" and "" and "&aClick to select!"
# Row 2
set slot 19 of {_p}'s current inventory to sentry armor trim smithing template named "&e&lSentry" with lore "&7Guardian design" and "" and "&aClick to select!"
set slot 20 of {_p}'s current inventory to vex armor trim smithing template named "&e&lVex" with lore "&7Mystical design" and "" and "&aClick to select!"
set slot 21 of {_p}'s current inventory to wild armor trim smithing template named "&e&lWild" with lore "&7Nature-inspired" and "" and "&aClick to select!"
set slot 22 of {_p}'s current inventory to silence armor trim smithing template named "&e&lSilence" with lore "&7Eerie design" and "" and "&aClick to select!"
set slot 23 of {_p}'s current inventory to tide armor trim smithing template named "&e&lTide" with lore "&7Oceanic design" and "" and "&aClick to select!"
set slot 24 of {_p}'s current inventory to snout armor trim smithing template named "&e&lSnout" with lore "&7Bastion design" and "" and "&aClick to select!"
set slot 25 of {_p}'s current inventory to rib armor trim smithing template named "&e&lRib" with lore "&7Skeletal design" and "" and "&aClick to select!"
# Row 3
set slot 28 of {_p}'s current inventory to eye armor trim smithing template named "&e&lEye" with lore "&7Watchful design" and "" and "&aClick to select!"
set slot 29 of {_p}'s current inventory to spire armor trim smithing template named "&e&lSpire" with lore "&7Towering design" and "" and "&aClick to select!"
# Back button
set slot 49 of {_p}'s current inventory to arrow named "&e&lBack" with lore "&7Return to armor selection"
# ═══════════════════════════════════════════════════════════════
# MATERIAL SELECTION MENU
# ═══════════════════════════════════════════════════════════════
function openMaterialGUI(p: player, pattern: text):
set {trim::%{_p}%::pattern} to {_pattern}
open chest with 4 rows named "&8Armor Trims &7- &6Select Material" to {_p}
# Background
loop 36 times:
set slot (loop-number - 1) of {_p}'s current inventory to gray stained glass pane named " "
# All 11 materials
set slot 10 of {_p}'s current inventory to quartz named "&f&lQuartz" with lore "&7Clean white trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 11 of {_p}'s current inventory to iron ingot named "&7&lIron" with lore "&7Gray metallic trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 12 of {_p}'s current inventory to netherite ingot named "&8&lNetherite" with lore "&7Dark gray trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 13 of {_p}'s current inventory to redstone named "&c&lRedstone" with lore "&7Bright red trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 14 of {_p}'s current inventory to copper ingot named "&6&lCopper" with lore "&7Orange-brown trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 15 of {_p}'s current inventory to gold ingot named "&e&lGold" with lore "&7Shiny yellow trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 16 of {_p}'s current inventory to emerald named "&a&lEmerald" with lore "&7Bright green trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 20 of {_p}'s current inventory to diamond named "&b&lDiamond" with lore "&7Bright cyan trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 21 of {_p}'s current inventory to lapis lazuli named "&9&lLapis" with lore "&7Deep blue trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 22 of {_p}'s current inventory to amethyst shard named "&d&lAmethyst" with lore "&7Purple trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
set slot 23 of {_p}'s current inventory to brick named "&4&lResin" with lore "&7Dark red trim" and "&7Pattern: &e%{_pattern}%" and "" and "&aClick to apply!"
# Back button
set slot 31 of {_p}'s current inventory to arrow named "&e&lBack" with lore "&7Choose a different pattern"
# ═══════════════════════════════════════════════════════════════
# APPLY TRIM TO ARMOR
# ═══════════════════════════════════════════════════════════════
function applyArmorTrim(p: player, material: text):
set {_piece} to {trim::%{_p}%::piece}
set {_pattern} to {trim::%{_p}%::pattern}
# Get the current armor
if {_piece} is "helmet":
set {_armor} to {_p}'s helmet
else if {_piece} is "chestplate":
set {_armor} to {_p}'s chestplate
else if {_piece} is "leggings":
set {_armor} to {_p}'s leggings
else if {_piece} is "boots":
set {_armor} to {_p}'s boots
# Check if still equipped
if {_armor} is not set:
send "{@prefix} &cYou no longer have that armor piece equipped!" to {_p}
play sound "entity.villager.no" with volume 1 and pitch 1 to {_p}
close {_p}'s inventory
stop
# Apply trim using SkBee NBT
set {_nbt} to "{Trim:{material:""%{_material}%"",pattern:""%{_pattern}%""}}"
set {_armor} to {_armor} with nbt {_nbt}
# Update the armor slot
if {_piece} is "helmet":
set {_p}'s helmet to {_armor}
else if {_piece} is "chestplate":
set {_p}'s chestplate to {_armor}
else if {_piece} is "leggings":
set {_p}'s leggings to {_armor}
else if {_piece} is "boots":
set {_p}'s boots to {_armor}
# Success feedback
send "{@prefix} &aApplied &e%{_pattern}% &apattern with &e%{_material}% &amaterial!" to {_p}
play sound "entity.player.levelup" with volume 0.5 and pitch 1.2 to {_p}
# Cleanup
delete {trim::%{_p}%::piece}
delete {trim::%{_p}%::pattern}
# Return to main menu
wait 10 ticks
openTrimsMainGUI({_p})