Package org.geysermc.geyser.item.type
Class NonVanillaItem
java.lang.Object
org.geysermc.geyser.item.type.Item
org.geysermc.geyser.item.type.NonVanillaItem
-
Nested Class Summary
Nested classes/interfaces inherited from class org.geysermc.geyser.item.type.Item
Item.Builder -
Field Summary
Fields inherited from class org.geysermc.geyser.item.type.Item
javaIdentifier -
Constructor Summary
ConstructorsConstructorDescriptionNonVanillaItem(String javaIdentifier, Item.Builder builder, @NonNull List<ResolvableComponent<?>> resolvableComponents) -
Method Summary
Modifier and TypeMethodDescription@NonNull @UnmodifiableView org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentsgatherComponents(@Nullable ComponentCache componentCache, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents others) Returns an unmodifiableDataComponentsview containing known data components.<T> @Nullable TgetComponent(@Nullable ComponentCache componentCache, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<T> type) Returns this items value (or null) for a specificDataComponentType.@NonNull List<ResolvableComponent<?>>Methods inherited from class org.geysermc.geyser.item.type.Item
builder, byBlock, defaultAttackDamage, defaultMaxDamage, defaultMaxStackSize, ignoreDamage, is, is, javaId, javaIdentifier, javaKey, newItemStack, registerBlock, remapEnchantment, setJavaId, toBedrockDefinition, toString, translateComponentsToBedrock, translateDyedColor, translateNbtToJava, translateToBedrock, translateToJava, translationKey
-
Constructor Details
-
NonVanillaItem
public NonVanillaItem(String javaIdentifier, Item.Builder builder, @NonNull List<ResolvableComponent<?>> resolvableComponents)
-
-
Method Details
-
gatherComponents
public @NonNull @UnmodifiableView org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents gatherComponents(@Nullable ComponentCache componentCache, @Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents others) Description copied from class:ItemReturns an unmodifiableDataComponentsview containing known data components. Optionally, additional components can be provided to replace (or add to) the items' base components. To add data components, useGeyserItemStack.getOrCreateComponents().- Overrides:
gatherComponentsin classItem
-
getComponent
public <T> @Nullable T getComponent(@Nullable ComponentCache componentCache, @NonNull org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponentType<T> type) Description copied from class:ItemReturns this items value (or null) for a specificDataComponentType. Prefer usingGeyserItemStack.getComponent(DataComponentType)to also query additional components that would override the default ones.- Overrides:
getComponentin classItem
-
resolvableComponents
-