Interface ItemPredicateContext
- All Superinterfaces:
MinecraftPredicateContext
Item context. Used for predicates in
CustomItemDefinitions.- Since:
- 2.9.3
-
Method Summary
Modifier and TypeMethodDescriptionfloat@NonNull List<@NonNull ChargedProjectile>@NonNull List<@NonNull Identifier>intcount()booleancustomModelDataFlag(int index) floatcustomModelDataFloat(int index) @Nullable StringcustomModelDataString(int index) intdamage()booleanintint@Nullable IdentifierbooleanMethods inherited from interface org.geysermc.geyser.api.predicate.context.MinecraftPredicateContext
dimension
-
Method Details
-
count
int count()- Returns:
- the stack size
- Since:
- 2.9.3
-
maxStackSize
int maxStackSize()- Returns:
- the max stack size
- Since:
- 2.9.3
-
damage
int damage()- Returns:
- the value of the
minecraft:damagecomponent, or 0 if not present - Since:
- 2.9.3
-
maxDamage
int maxDamage()- Returns:
- the value of the
minecraft:max_damagecomponent, or 0 if not present - Since:
- 2.9.3
-
hasFishingRodCast
boolean hasFishingRodCast()- Returns:
- if the session player is holding a fishing rod cast
- Since:
- 2.9.3
-
unbreakable
boolean unbreakable()- Returns:
- true if the
minecraft:unbreakablecomponent is present - Since:
- 2.9.3
-
bundleFullness
float bundleFullness()- Returns:
- the bundle's fullness from the
minecraft:bundle_contentscomponent, or 0 if not present - Since:
- 2.9.3
-
trimMaterial
@Nullable Identifier trimMaterial()- Returns:
- the identifier of the item's trim material, or null if no trim is present
- Since:
- 2.9.3
-
chargedProjectiles
@NonNull List<@NonNull ChargedProjectile> chargedProjectiles()- Returns:
- all the charged projectiles in the
minecraft:charged_projectilescomponent - Since:
- 2.9.3
-
components
@NonNull List<@NonNull Identifier> components()- Returns:
- a list of all the components present on the item, including default components
- Since:
- 2.9.3
-
customModelDataFlag
boolean customModelDataFlag(int index) - Parameters:
index- the flag index- Returns:
- a flag of the item's custom model data, defaults to false
- Since:
- 2.9.3
-
customModelDataString
- Parameters:
index- the string index- Returns:
- a string of the item's custom model data. Returns null if index is out of range
- Since:
- 2.9.3
-
customModelDataFloat
float customModelDataFloat(int index) - Parameters:
index- the float index- Returns:
- a float of the item's custom model data, defaults to 0.0
- Since:
- 2.9.3
-