Expert users

Installing the required dependencies

To get more info about skript-mirror please read its wiki
I'm not a skript expert and I'm not the developer of skript nor skript-mirror. Every question about skript will be ignored, I hope you understand.

Examples

Getting item on command
Check if clicked block is custom block
Custom GUI
1
import:
2
dev.lone.itemsadder.api.ItemsAdder
3
4
command /iaskript:
5
trigger:
6
set {testItem} to ItemsAdder.getCustomItem("itemsadder:ruby")
7
sender.getInventory().addItem({testItem})
Copied!
1
import:
2
dev.lone.itemsadder.api.ItemsAdder
3
org.bukkit.event.player.PlayerInteractEvent
4
org.bukkit.inventory.EquipmentSlot as EquipmentSlot
5
6
on PlayerInteractEvent:
7
if event.getHand() is EquipmentSlot.OFF_HAND:
8
stop
9
10
set {clickedBlock} to event.getClickedBlock()
11
set {isCustomBlock} to ItemsAdder.isCustomBlock({clickedBlock})
12
event.getPlayer().sendMessage("Is custom block: %{isCustomBlock}%")
13
14
if {isCustomBlock} is true:
15
set {tmp} to ItemsAdder.getCustomBlock({clickedBlock})
16
set {name} to {tmp}.getItemMeta().getDisplayName()
17
event.getPlayer().sendMessage("%{name}%")
Copied!
1
import:
2
dev.lone.itemsadder.api.ItemsAdder
3
dev.lone.itemsadder.api.FontImages.TexturedInventoryWrapper
4
dev.lone.itemsadder.api.FontImages.FontImageWrapper
5
org.bukkit.entity.Player
6
7
8
9
command /iaguitest:
10
trigger:
11
12
set {customTexture} to new FontImageWrapper("mcguis:blank_menu")
13
set {gui} to new TexturedInventoryWrapper(null, 54, "&0Test" and {customTexture})
14
set {icon} to ItemsAdder.getCustomItem("mcicons:icon_confirm")
15
add player to {players::*}
16
set slot 12 of {gui}.getInternal() to {icon}
17
{gui}.showInventory(player)
18
19
on inventory click:
20
if {players::*} contain player:
21
if index of event-slot = 12:
22
cancel event
23
send "Confirmed!"
24
25
on inventory close:
26
remove player from {players::*}
Copied!
Last modified 1yr ago