Interface GeyserDefineCustomItemsEvent
- All Superinterfaces:
org.geysermc.event.Event
@NonExtendable
public interface GeyserDefineCustomItemsEvent
extends org.geysermc.event.Event
Called on Geyser's startup when looking for custom items. Custom items must be registered through this event.
This event will not be called if the "add-non-bedrock-items" setting is disabled in the Geyser config.
-
Method Summary
Modifier and TypeMethodDescription@NonNull Map<Identifier, Collection<CustomItemDefinition>> A multimap of all the already registered custom item definitions indexed by theIdentifierof the Java item which the item is based on.@NonNull Map<String, Collection<CustomItemData>> Deprecated.@NonNull List<NonVanillaCustomItemData> Deprecated.replaced bynonVanillaCustomItemDefinitions()@NonNull Map<Identifier, Collection<NonVanillaCustomItemDefinition>> A multimap of all the already registered non-vanilla custom item definitions indexed by the non-vanilla Java itemIdentifierthese are mapped to.booleanregister(@NonNull String identifier, @NonNull CustomItemData customItemData) Deprecated.booleanregister(@NonNull NonVanillaCustomItemData customItemData) Deprecated.voidregister(@NonNull NonVanillaCustomItemDefinition customItemDefinition) Registers a custom item with no base Java edition item.voidregister(@NonNull Identifier identifier, @NonNull CustomItemDefinition customItemDefinition) Registers a Bedrock custom item definition based on a Java item.
-
Method Details
-
getExistingCustomItems
Deprecated.replaced bycustomItemDefinitions()A multimap of all the already registered custom items indexed by the item's extended java item's identifier. The map returned here will only contain items registered with the deprecatedregister(String, CustomItemData)method. -
customItemDefinitions
@NonNull Map<Identifier,Collection<CustomItemDefinition>> customItemDefinitions()A multimap of all the already registered custom item definitions indexed by theIdentifierof the Java item which the item is based on.- Since:
- 2.9.3
-
getExistingNonVanillaCustomItems
Deprecated.replaced bynonVanillaCustomItemDefinitions()A list of the already registered non-vanilla custom items. The map returned here will only contain items registered with the deprecatedregister(NonVanillaCustomItemData)method. -
nonVanillaCustomItemDefinitions
@NonNull Map<Identifier,Collection<NonVanillaCustomItemDefinition>> nonVanillaCustomItemDefinitions()A multimap of all the already registered non-vanilla custom item definitions indexed by the non-vanilla Java itemIdentifierthese are mapped to.This multimap will, at the moment, always have one entry per key.
- Since:
- 2.9.3
-
register
Deprecated.Registers a custom item with a base Java item. This is used to register items with custom textures and properties based on NBT data. This method should not be used anymore,CustomItemDefinitions are preferred now and this method will convertCustomItemDatatoCustomItemDefinitioninternally.- Parameters:
identifier- the base (java) itemcustomItemData- the custom item data to register- Returns:
- if the item was registered
-
register
Registers a Bedrock custom item definition based on a Java item. This is used to register items with custom textures and properties created using item data component patches.- Parameters:
identifier- of the Java edition base itemcustomItemDefinition- the custom item definition to register- Throws:
CustomItemDefinitionRegisterException- when an error occurred while registering the item- Since:
- 2.9.3
-
register
Deprecated.Registers a custom item with no base item. This is used for mods. This method should not be used anymore,NonVanillaCustomItemDefinitions are preferred now and this method will convertNonVanillaCustomItemDatatoNonVanillaCustomItemDefinitioninternally.- Parameters:
customItemData- the custom item data to register- Returns:
- if the item was registered
-
register
Registers a custom item with no base Java edition item. This is used for non-vanilla items added by mods.- Parameters:
customItemDefinition- the custom item definition to register- Throws:
CustomItemDefinitionRegisterException- when an error occurred while registering the item- Since:
- 2.9.3
-
customItemDefinitions()