tutorial:items_docs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorial:items_docs [2020/04/01 19:22] – save point for Item.Settings docs draylar | tutorial:items_docs [2023/06/12 16:25] (current) – mineblock11 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | :!: //This page is archived.// | ||
+ | |||
====== Items ====== | ====== Items ====== | ||
- | Items are the pieces of content that appear in your inventory. They can perform actions when you click, act as food, or spawn entities. The following documentation will give you a rundown of the entire '' | + | |
+ | Items are the pieces of content that appear in your inventory. They can perform actions when you click, act as food, or spawn entities. The following documentation will give you a rundown of the entire '' | ||
===== Item Settings ===== | ===== Item Settings ===== | ||
Line 7: | Line 10: | ||
^ Method | ^ Method | ||
- | | food | FoodComponent | Changes the Item to be edible based on the given '' | + | | food | '' |
- | | maxCount | + | | maxCount |
- | | maxDamageIfAbsent | int | Sets the Item's maximum damage count if it hasn't already been set. | | + | | maxDamageIfAbsent | '' |
- | | maxDamage |int | Sets the Item's max stack durability. | | + | | maxDamage | '' |
- | | recipeRemainder | Item | Sets the Item's recipe remainder, which is given back to the player after the Item is used in a recipe. | | + | | recipeRemainder | '' |
- | | group | ItemGroup | + | | rarity |
- | | rarity | + | | fireproof |
+ | |||
+ | ===== Fabric | ||
+ | The Fabric Item API provides extra methods to set even more attributes. To use it, just replace '' | ||
+ | Heres the list of additional functionalities '' | ||
+ | |||
+ | ^ Method | ||
+ | | equipmentSlot | '' | ||
+ | | customDamage | '' | ||
---- | ---- | ||
Line 21: | Line 32: | ||
public Item.Settings food(FoodComponent foodComponent) | public Item.Settings food(FoodComponent foodComponent) | ||
</ | </ | ||
- | '' | + | '' |
---- | ---- | ||
Line 29: | Line 40: | ||
public Item.Settings maxCount(int maxCount) | public Item.Settings maxCount(int maxCount) | ||
</ | </ | ||
- | '' | + | '' |
+ | ---- | ||
+ | ==== Max Damage if Absent ==== | ||
+ | <code java> | ||
+ | public Item.Settings maxDamageIfAbsent(int maxDamage) | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | If '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Max Damage ==== | ||
+ | <code java> | ||
+ | public Item.Settings maxDamage(int maxDamage) | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Recipe Remainder ==== | ||
+ | <code java> | ||
+ | public Item.Settings recipeRemainder(Item recipeRemainder) | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | When a recipe remainder is set on an Item, any recipe using that Item will return the remainder on craft. This is used for buckets (Water, Lava, Milk) and bottles (Dragon Breath, Honey) returning their respective empty items when used in recipes. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Rarity ==== | ||
+ | <code java> | ||
+ | public Item.Settings rarity(Rarity rarity) | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | If Rarity is set, the given Item will have a custom name color. An Item's Rarity defaults to common. | ||
+ | ^ Rarity ^ Color ^ | ||
+ | | Common | White | | ||
+ | | Uncommon | Yellow | | ||
+ | | Rare | Aqua | | ||
+ | | Epic | Light Purple | | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Fireproof ==== | ||
+ | <code java> | ||
+ | public Item.Settings fireproof() | ||
+ | </ | ||
+ | Marks the item as being fireproof, and protects the item entity that contains the item from fire and lava. |
tutorial/items_docs.txt · Last modified: 2023/06/12 16:25 by mineblock11