The Items module can be used to create an item of any type.
Here is an overview of the Items functions:
Function | Parameters | Results |
---|---|---|
get | name, amount | Item |
Below you find short descriptions about each of the functions and some examples about how to use them in your spells.
The ‘get’ function returns a new item of the given type and amount.
Creating one diamond axe and putting it into the player’s hand.
local axe = Items.get("diamond_axe")
spell.owner.mainhand = axe
Creating a full stack of wheat and putting it into the wizard’s hand.
spell.owner.mainhand = Items.get("wheat", 64)