JAVA
Used to execute java code
.
java_imports:
- org.bukkit.inventory.ItemStack
- org.bukkit.Material
vars:
- " $item_diamond$ | java = new ItemStack(Material.DIAMOND)"
INTERNAL
Run internal functions
.
vars:
- " $item$ | internal = getItemStackByAdapter( item = mc:emerald_block ) "
TEXT
It is simply used to put text
.
vars:
- " $text$ | text = test text "
NUMBER
It is simply used to put a number using the Integer Class instance
.
vars:
- " $number$ | number = 1000 "
EVENT
It is an argument used to obtain data from the executed event.
Each event in the wiki has its class because the methods are in the class, for example in the example below I will show you with the click event interface item
.
vars:
- " $item$ | event =
getRawSlot() "
ADAPTER
It is used to compute the false id with the real adapter id
Imagine that you want to make a condition that compares the item id of slot 0 and the item id of the variable. If we do this by putting text in the argument instead of adapter, the id will be "mc:stone"
so when it compares it will show that it is false even if it is true.
Why is this happening? simply because the internal adapter id system transforms the "mc:stone"
to "{id:"minecraft:stone",Count:1b}"
or something like that, then you already know why you should use adapter if you are going to make these types of comparisons.
.
vars:
- " $itemId$ | adapter = mc:stone "
- " $itemSlot$ | event = getCurrentItem()" # clicked item
conditions:
- "{internal = getAdapterId( item = $itemSlot$ )} == {var = $itemId$}"
VAR
The use of this variable is several things, one of them is the use of remapping other variables.
For example to use remapping to use %% text replacement.
Remember that you must know beforehand what this is for, read what differences there are between $$ and %%.
.
vars:
- " %replacement% | var = $player_name$"
INVENTORY
It is simply a shortcut to the Inventory object.
You can use all the methods of the Inventory class
.
vars:
- " $slot_item_9$ | inventory = getItem(9) "
FLOAT
It is simply used to declare a float value
.
vars:
- " $floatValue$ | float = 1.6 "
BOOLEAN
It simply serves to declare a boolean value as true or false
.
vars:
- " $randomVar$ | boolean = true "