Adding VendingMachines!
How to add a Vending Machine:
This tutorial is about creating the config, we wont teach you how to 3d model or create resourcepacks.
1) Under "plugins/VendingMachines/VendingMachines" create a new file and name it however you want.
2) Copy the default config (the following config) and edit it as you want.
Code (YAML):
# The identifier must be unique, and you must not change it.
# Its used by the placedVms to know what type of confif to use.
Identifier
: VendingMachines
# The material can be a spigot material or an ItemsAdder material.
# Note that when the plugin creates the default config checks if you are using IA.
# In this example its using IA. If the material cant be located, the config won't load.
# Normal material example. Material: LEATHER_HORSE_ARMOR
Material
: vending_machine_1
# The custom model data that the plugin should use for this vending machine.
# If the material is an IA material this is ignored and lets IA handle that.
CustomModelData
: 0
# The UI that the plugin should use if IA is not installed. This is the ui identifier.
CustomUI_Default
: Default UI
# The UI that the plugin should use IA is installed. This is the ui identifier.
CustomUI_IA
: IA UI 1
# If free rotation is set to false, the VM will always be facing to North, south, east or weast.
# Note that "MaxRandomRotation" is also applied, so if you want it to be perfectly aligned
# set "MaxRandomRotation" to 0
FreeRotation
: false
# This is a value that modifies the ammount of random rotation that is applied to a VM
# when is placed. Set it to 0 if you dont want any.
# Random rotation works with free rotation as true and false.
MaxRandomRotation
: 4
# If the vm should be tintable, this only works if the material has leather properties,
# and the 3d model was properly created.
Tintable
: true
# List of points where items should be displayed, in this case there is none.
# In this example there are 3 possible locations
# If you want to disable it set it to: ItemLocations: []
# There is an already configured vm with 9 locations in the file "Vending Machine 1 (empty).yml"
ItemLocations:
- ==
: Vector
x
: -0.15
y
: -0.15
z
: 0.2
- ==
: Vector
x
: 0.075
y
: -0.15
z
: 0.15
- ==
: Vector
x
: 0.3
y
: -0.15
z
: 0.2
Adding Custom UIs!
How to add a Custom UI
This tutorial is about creating the config, we wont teach you how to create textures or add UIs into itemsadder
1) Under "plugins/VendingMachines/CustomUIs" create a new file and name it however you want.
2) Copy the default config (the following config) and edit it as you want.
# The identifier must be unique, and you must not change it.
# Its used by the VendingMachines to know what UI to use.
Identifier: Default UI
# This is the title that will be shown to players in the inventory (you can use colors with &)
CustomIAUI: Vending Machine!
Code (YAML):
# IS_2 and IS_3 can be used always but there is a simpler config for IA users.
# IS_2 is the left arrow itemstack, this is the default config which uses the item paper
# with a custom model data of 10000. Thats the default left arrow in the rp.
# You can use this methon always, but if you have IA, I recommend using that method.
IS_2:
==
: org.bukkit.inventory.ItemStack
v
: 3465
type
: PAPER
meta:
==
: ItemMeta
meta-type
: UNSPECIFIC
display-name
: '
{
"extra":
[
{
"bold":false,
"italic":false,
"underlined":false,
"strikethrough":false,
"obfuscated":false,
"color":
"green",
"text":
"Back"
}
],
"text":
""
}'
custom-model-data
: 10000
# Same as IS_2 but for right arrow.
IS_3:
==
: org.bukkit.inventory.ItemStack
v
: 3465
type
: PAPER
meta:
==
: ItemMeta
meta-type
: UNSPECIFIC
display-name
: '
{
"extra":
[
{
"bold":false,
"italic":false,
"underlined":false,
"strikethrough":false,
"obfuscated":false,
"color":
"green",
"text":
"Next"
}
],
"text":
""
}'
custom-model-data
: 10001
# IA_Material_2 and IA_Material_3 can be used only when IA is installed.
# those are the IA materials that should be used for arrow. Example
# IA_Material_2: _iainternal:icon_left_blue
# IA_Material_3: _iainternal:icon_right_blue
# If you want to use the IA method remove IS_2 and IS_3 and uncomment the IA_Material_2 and IA_Material_3
# This is the config used to know where to put the items in the VM and where to put the arrows.
# 0 = empty.
# 1 = vendin machine item
# 2 = left arrow
# 3 = right arrow
Slots
:
- - 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- - 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- - 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- - 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- - 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- 1
- - 2
- 0
- 1
- 1
- 1
- 1
- 1
- 0
- 3
That config will look like something like this:
The UI "IA UI 1.yml" looks like this: