Package com.ericlam.mc.eld.services
Interface ItemStackService.ItemFactory
- Enclosing interface:
- ItemStackService
public static interface ItemStackService.ItemFactory
物品工廠
-
Method Summary
Modifier and TypeMethodDescriptionamount(int amount) 修改數量解除進食事件解除左右鍵事件顯示名稱durability(int damage) 修改耐久度editItemMeta(Consumer<ItemMeta> meta) 編輯物品editPersisData(Consumer<PersistentDataContainer> dataEditor) 設置物品數據儲存器enchant(Consumer<Map<Enchantment, Integer>> enchantEditor) 修改附魔enchant(Map<Enchantment, Integer> enchants) 設置附魔enchant(Enchantment enchantment, int level) 新增附魔getItem()獲取物品設置頭顱皮膚, 物品必須為 PLAYER_HEADhead(OfflinePlayer player) Deprecated.設置 item flags新增敘述修改敘述設置敘述修改類別modelData(int modelData) 設置 model dataonConsumeEvent(String keyExecute) 執行進食事件onConsumeEventTemp(Consumer<PlayerItemConsumeEvent> handler) 執行臨時的進食事件 (伺服器重啟後消失)onInteractEvent(String keyExecute) 執行左右鍵事件onInteractEventTemp(Consumer<PlayerInteractEvent> handler) 執行臨時的左右鍵事件 (伺服器重啟後消失)unbreakable(boolean unbreakable) 設置不可破壞
-
Method Details
-
material
修改類別- Parameters:
material- 類別- Returns:
- this
-
amount
修改數量- Parameters:
amount- 數量- Returns:
- this
-
durability
修改耐久度- Parameters:
damage- 耐久度- Returns:
- this
-
display
顯示名稱- Parameters:
display- 顯示名稱- Returns:
- this
-
lore
新增敘述- Parameters:
lore- 敘述(行)- Returns:
- this
-
lore
設置敘述- Parameters:
lore- 敘述- Returns:
- this
-
lore
修改敘述- Parameters:
loreEditor- 修改敘述- Returns:
- this
-
enchant
新增附魔- Parameters:
enchantment- 附魔level- 等級- Returns:
- this
-
enchant
設置附魔- Parameters:
enchants- 附魔表- Returns:
- this
-
enchant
修改附魔- Parameters:
enchantEditor- 附魔編輯- Returns:
- this
-
head
Deprecated.不建議使用,因為每次使用都會請求 URL, 建議使用head(String)設置頭顱皮膚, 物品必須為 PLAYER_HEAD- Parameters:
player- 玩家- Returns:
- this
-
head
設置頭顱皮膚, 物品必須為 PLAYER_HEAD- Parameters:
skullKey- 皮膚ID- Returns:
- this
-
unbreakable
設置不可破壞- Parameters:
unbreakable- 不可破壞- Returns:
- this
-
modelData
設置 model data- Parameters:
modelData- model data- Returns:
- this
-
itemFlags
設置 item flags- Parameters:
itemFlags- item flags- Returns:
- this
-
editItemMeta
編輯物品- Parameters:
meta- 物品meta- Returns:
- this
-
editPersisData
設置物品數據儲存器- Parameters:
dataEditor- 數據儲存編輯- Returns:
- this
-
onInteractEvent
執行左右鍵事件- Parameters:
keyExecute- 標識id- Returns:
- this
-
onInteractEventTemp
執行臨時的左右鍵事件 (伺服器重啟後消失)- Parameters:
handler- 事件處理- Returns:
- this
-
onConsumeEventTemp
執行臨時的進食事件 (伺服器重啟後消失)- Parameters:
handler- 事件處理- Returns:
- this
-
onConsumeEvent
執行進食事件- Parameters:
keyExecute- 標識id- Returns:
- this
-
destroyInteractEvent
解除左右鍵事件- Returns:
- this
-
destroyClickerEvent
解除進食事件- Returns:
- this
-
getItem
獲取物品- Returns:
- 物品
-
head(String)