Package ch.njol.skript.bukkitutil
Class ItemComponentUtils
java.lang.Object
ch.njol.skript.bukkitutil.ItemComponentUtils
Utilily methods to handle
DataComponents
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isConsumable
(ItemStack item) Check if an ItemStack has a consumable componentstatic boolean
isFireResistant
(ItemStack item) Check if an ItemStack is resistant to firestatic void
setFireResistant
(ItemStack item, boolean resistant) Set whether an ItemStack is fire-resistant
-
Constructor Details
-
ItemComponentUtils
public ItemComponentUtils()
-
-
Method Details
-
isConsumable
Check if an ItemStack has a consumable component- Parameters:
item
- ItemStack to check- Returns:
- True if item has consumable component
-
isFireResistant
Check if an ItemStack is resistant to fireThis does not check enchantments, only data component for damage resistance
- Parameters:
item
- ItemStack to check- Returns:
- True if fire-resistant
-
setFireResistant
Set whether an ItemStack is fire-resistantThis can override vanilla resistance
- Parameters:
item
- ItemStack to modifyresistant
- Whether fire-resistant or not
-