Item Exchanger
Exchange items for items!
Commands:
/exchanger - Opens up the GUI for Exchanger
This is a Skript, you will need Skript and if you are planning to add Exchanged events as something else, you will need to have other addons for Skript such as SkQuery.
"I am a developer of a server, how do I configure it to my liking?"
Before you start, I suggest you getting to know the basics of Skript via tutorials or the Skript Community.
I am going to give a short tutorial on how to create an item exchange.
This is the main command, once /exchanger is executed, it pops up a GUI with 2 options.
It also comes along with the Lore and name.
ITEM in GUI code:
Opens up a GUI with 4 rows and the name of the GUI is Exchanger
Format slot 0 meaning, the SLOT number, if you have 4 rows set, you will have 36 slots but the number must "-1" off the slot number you wish to have the item at,
example, If you want item X at slot 23, you will have to put the SLOT as 22.
Same goes for slot 1, set it as slot 0, vice versa.
You can set the display item as whatever you want, the name and the lore.
If you wish to have multiple lores on the display item, you will have to put "||"
Execute command, meaning what command will be executed when a player clicks on the item. It is important to link the item to a command, you will see in the next step.
Command "<command>" command to allow the player to execute, this is important as stated above, it runs all the events.
if player has.... It detects if the player has the item, if so, the event will be executed.
and that`s all, you can define any events, but if you have a cost, you might want to remove the item like using the code
One more example,
Requirements:
- Skript
- SkQuery
Exchange items for items!
Commands:
/exchanger - Opens up the GUI for Exchanger
This is a Skript, you will need Skript and if you are planning to add Exchanged events as something else, you will need to have other addons for Skript such as SkQuery.
"I am a developer of a server, how do I configure it to my liking?"
Before you start, I suggest you getting to know the basics of Skript via tutorials or the Skript Community.
I am going to give a short tutorial on how to create an item exchange.
Code (Text):
command /exchanger: #Executed command to cause events
trigger: #Triggers {Events}
wait 1 tick
open chest with 4 row named "&e&lExhanger" to player
format slot 0 of player with diamond sword named "&eNice Sword" with lore "&b&lCosts:||&7 - 2x Gold Ingot||&7 - 1x Ice Cream Sword||&7A nice sword||Indeed...." to close then run [make player execute command "event-purchase-NiceSword"]
format slot 1 of player with stone sword named "&eIce Cream Sword" with lore "&b&lCosts:||&7 - 21x Diamond||&7 - 6x Ice||&7A grand, tasty sword." to close then run [make player execute command "event-purchase-IceCreamSword"]
trigger: #Triggers {Events}
wait 1 tick
open chest with 4 row named "&e&lExhanger" to player
format slot 0 of player with diamond sword named "&eNice Sword" with lore "&b&lCosts:||&7 - 2x Gold Ingot||&7 - 1x Ice Cream Sword||&7A nice sword||Indeed...." to close then run [make player execute command "event-purchase-NiceSword"]
format slot 1 of player with stone sword named "&eIce Cream Sword" with lore "&b&lCosts:||&7 - 21x Diamond||&7 - 6x Ice||&7A grand, tasty sword." to close then run [make player execute command "event-purchase-IceCreamSword"]
It also comes along with the Lore and name.
ITEM in GUI code:
Code (Text):
open chest with 4 row named "&e&lExhanger" to player
Opens up a GUI with 4 rows and the name of the GUI is Exchanger
Code (Text):
format slot 0 of player with diamond sword named "&eNice Sword" with lore "&b&lCosts:||&7 - 2x Gold Ingot||&7 - 1x Ice Cream Sword||&7A nice sword||Indeed...." to close then run [make player execute command "event-purchase-NiceSword"]
Format slot 0 meaning, the SLOT number, if you have 4 rows set, you will have 36 slots but the number must "-1" off the slot number you wish to have the item at,
example, If you want item X at slot 23, you will have to put the SLOT as 22.
Same goes for slot 1, set it as slot 0, vice versa.
You can set the display item as whatever you want, the name and the lore.
If you wish to have multiple lores on the display item, you will have to put "||"
Execute command, meaning what command will be executed when a player clicks on the item. It is important to link the item to a command, you will see in the next step.
Code (Text):
command /event-purchase-IceCreamSword:
trigger:
loop 1 times:
loop all items in player's inventory:
if player has 6 Ice:
if player has 21 Diamond:
message "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword"
remove 21 diamond from player's inventory
remove 6 ice from player's inventory
add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to the player
stop
trigger:
loop 1 times:
loop all items in player's inventory:
if player has 6 Ice:
if player has 21 Diamond:
message "&eYou have exchanged 21 Diamonds and 6 Ice for 1x Ice Cream Sword"
remove 21 diamond from player's inventory
remove 6 ice from player's inventory
add 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." to the player
stop
Command "<command>" command to allow the player to execute, this is important as stated above, it runs all the events.
if player has.... It detects if the player has the item, if so, the event will be executed.
and that`s all, you can define any events, but if you have a cost, you might want to remove the item like using the code
Code (Text):
remove 21 diamond from player's inventory
One more example,
Code (Text):
command /event-purchase-NiceSword:
trigger:
loop 1 times:
loop all items in player's inventory:
if name of loop-item contains "&eIce Cream Sword":
if player has 2 gold ingots:
message "&eYou have exchanged 2 Gold Ingots and 1 Ice Cream Sword for 1x Nice Sword" to the player
remove 2 gold ingot from player's inventory
remove 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." from the player
add 1 diamond sword with name "&eNice Sword" with lore "&7Only for nice people||&7||&7NICE!" to the player
stop
trigger:
loop 1 times:
loop all items in player's inventory:
if name of loop-item contains "&eIce Cream Sword":
if player has 2 gold ingots:
message "&eYou have exchanged 2 Gold Ingots and 1 Ice Cream Sword for 1x Nice Sword" to the player
remove 2 gold ingot from player's inventory
remove 1 stone sword with name "&eIce Cream Sword" with lore "&7Ice Cream is good||&7I like it." from the player
add 1 diamond sword with name "&eNice Sword" with lore "&7Only for nice people||&7||&7NICE!" to the player
stop
Requirements:
- Skript
- SkQuery
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.8
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Item Exchanger | Configure the items to exchange | Skript is a free Minecraft Java mod. Compatible with Minecraft 1.8. Downloaded 580 times (via Spigot). Download it and open it directly in the game.