Interface NonVanillaCustomItemDefinition.Builder
- All Superinterfaces:
CustomItemDefinition.Builder,GenericBuilder<CustomItemDefinition>
- Enclosing interface:
NonVanillaCustomItemDefinition
Builder for non-vanilla custom item definitions.
- Since:
- 2.9.3
-
Method Summary
Modifier and TypeMethodDescriptionSets the Bedrock item options for this definition.build()Creates the non-vanilla custom item definition.component(ItemDataComponent<T> component, T value) Sets data components that determine the item behavior.displayName(String displayName) Sets the display name, as shown to the Bedrock client.priority(int priority) Sets the priority of this definition, used for definition matching.translationString(@Nullable String translationString) Sets the Java translation string of the item.Methods inherited from interface org.geysermc.geyser.api.item.custom.v2.CustomItemDefinition.Builder
component, predicate, predicateStrategy, removeComponent, removeComponent
-
Method Details
-
displayName
Sets the display name, as shown to the Bedrock client. When not set, the display name will be derived from the Bedrock item identifier.- Specified by:
displayNamein interfaceCustomItemDefinition.Builder- Parameters:
displayName- the display name to show for Bedrock clients.- Returns:
- this builder
- Since:
- 2.9.3
-
priority
Sets the priority of this definition, used for definition matching.- Specified by:
priorityin interfaceCustomItemDefinition.Builder- Parameters:
priority- the priority- Returns:
- this builder
- Since:
- 2.9.3
- See Also:
-
bedrockOptions
Sets the Bedrock item options for this definition. Those determine the icon seen on Bedrock edition, whether the item can be placed in the offhand slot, and other options.- Specified by:
bedrockOptionsin interfaceCustomItemDefinition.Builder- Parameters:
options- the bedrock item options- Returns:
- this builder
- Since:
- 2.9.3
- See Also:
-
component
Sets data components that determine the item behavior. These are assumed to also be present server-side on the Java server. SeeCustomItemDefinition.components()for more information.Added data components cannot be removed using
CustomItemDefinition.Builder.removeComponent(Identifier), and this method will throw when a component is added that was removed using the aforementioned method.- Specified by:
componentin interfaceCustomItemDefinition.Builder- Type Parameters:
T- the value held by the component- Parameters:
component- the type of the component, found inJavaItemDataComponentsvalue- the value of the component- Returns:
- this builder
- Since:
- 2.9.3
-
translationString
Sets the Java translation string of the item.- Parameters:
translationString- the Java translation string of the item- Returns:
- this builder
- Since:
- 2.9.3
-
build
NonVanillaCustomItemDefinition build()Creates the non-vanilla custom item definition.- Specified by:
buildin interfaceCustomItemDefinition.Builder- Specified by:
buildin interfaceGenericBuilder<CustomItemDefinition>- Returns:
- the new non-vanilla custom item definition
- Since:
- 2.9.3
-