Skip to content

Registry Documentation

Overview

The Registry class handles data registration across different modloaders and various Minecraft versions. It provides multiple methods to register different types of Minecraft objects such as items, blocks, screen handlers, professions, etc. This documentation covers the details and usage of each method provided by the Registry class.

Warning

Using this class requires a proper setup, follow this instructions to setup your environment

Methods


initRegistry(ICallBack _registery, UUID _currentRegistryTypes, String modid)

1.0.0

Initializes a Modloader's registry to be used for loading objects.

Info

Using this function is highly discouraged unless you have a deep understanding of its inner workings.

Parameters:

  • _registery: The registry callback.
  • _currentRegistryTypes: The type of registry.
  • modid: The Mod ID.

initRegistry(ICallBack _registery, IRegistryType _currentRegistryTypes, String modid)

1.0.0

Initializes a Modloader's registry to be used for loading objects.

Parameters:

  • _registery: The registry callback.
  • _currentRegistryTypes: The type of registry.
  • modid: The Mod ID.

ForgeEventResolver(Object eventData, ICallBack resolver, IRegistryType ResolveTypeOf, String modid)

1.0.0 1.19.2 yarn

Creates an Event resolver for Forge.

Parameters:

  • eventData: The event data.
  • resolver: The resolver callback.
  • ResolveTypeOf: The type of object this event resolves.
  • modid: The Mod ID.

ForgeEventResolver(Object eventData, ICallBack resolver, UUID ResolveTypeOf, String modid)

1.0.0 1.19.2 yarn

Creates an Event resolver for Forge.

Info

Using this function is highly discouraged unless you have a deep understanding of its inner workings.

Parameters:

  • eventData: The event data.
  • resolver: The resolver callback.
  • ResolveTypeOf: The type of object this event resolves.
  • modid: The Mod ID.

RegisterItem(String name, String Modid, Supplier aNew)

1.0.0 1.19.2 yarn

Registers a new Item for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The Item name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The supplier that provides the Item instance.

Returns: The registered data.


RegisterBlock(String name, String Modid, Supplier aNew, Item.Settings settings)

1.0.0 1.19.2 yarn

Registers a new Block for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The Block name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The supplier that provides the Block instance.
  • settings: The settings for the Block's inventory item.

Returns: The registered data.


RegisterBlockEntityType(String name, String Modid, IBlockEntityLoaderFunction aNew, Object block)

1.0.0 1.19.2 yarn

Registers a new Block Entity for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The Block Entity name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The supplier that provides the Block Entity instance.
  • block: The block to attach the entity to.

Returns: The registered data.


RegisterScreenHandlerType(String name, String Modid, IScreenHandlerTypeCreationFunction aNew)

1.0.0 1.19.2 yarn

Registers a new Screen Handler for Minecraft.

Parameters:

  • name: The Screen Handler name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The supplier that provides the Screen Handler instance.

Returns: The registered data.


RegisterHandledScreen(String name, String Modid, Object handlerType, IScreenHandledCreationFunction aNew)

1.0.0 1.19.2 yarn

Registers a new Handled Screen for Minecraft.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • handlerType: The handler type.
  • aNew: The supplier that provides the Handled Screen instance.

RegisterItemlessBlock(String name, String Modid, Supplier aNew)

1.0.0 1.19.2 yarn

Registers a new Itemless Block for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The Block name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The supplier that provides the Block instance.

Returns: The registered data.


RegisterPOI(String name, String Modid, Object block, int tickcount, int searchdistance)

1.0.0 1.19.2 yarn

Registers a new Point of Interest (POI) for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The POI name (ID).
  • Modid: The Mod ID of the registrar.
  • block: The block to attach the entity to.
  • tickcount: The POI tick count.
  • searchdistance: The search distance for the POI.

Returns: The registered data.


RegisterProfession(String name, String Modid, String aNew, Item[] itemImmutableSet, Block[] blockImmutableSet, SoundEvent sound)

1.0.0 1.19.2 yarn

Registers a new Villager Profession for Minecraft. Based on the mod loader, it either returns the Object itself or a RegistryObject of the Object.

Parameters:

  • name: The Villager Profession name (ID).
  • Modid: The Mod ID of the registrar.
  • aNew: The POI name (ID).
  • itemImmutableSet: Gatherable items.
  • blockImmutableSet: Secondary job sites.
  • sound: Work sound.

Returns: The registered data.


RegisterVillagerTrade(String name, String Modid, Object profession, int level, TradeOffer... trades)

1.0.0 1.19.2 yarn

Registers a new Villager Trade for Minecraft.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • profession: The villager profession.
  • level: The trade level.
  • trades: The trade offers.

RegisterOreConfiguredFeature(String name, String Modid, Supplier> targets, int size)

1.0.0 1.19.2 yarn

Registers a new Ore Configured Feature for Minecraft.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • targets: The supplier that provides the ore targets.
  • size: The size of the ore feature.

Returns: The registered data.


RegisterPlacedFeature(String name, String Modid, Object configured_feat, Object data)

1.0.0 1.19.2 yarn

Registers a new Placed Feature for Minecraft.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • configured_feat: The configured feature.
  • data: The feature data.

Returns: The registered data.


AddBiomeModification(String name, String Modid, VinillaBiomeTypes biomeTypes, GenerationStep.Feature gen_step, Object Placed_ore)

1.1.0 1.19.2 yarn

Adds a biome modification.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • biomeTypes: The biome types.
  • gen_step: The generation step.
  • Placed_ore: The placed ore.

RegisterRecipeSerializer(String name, String Modid, RecipeSerializer serializer_instance)

1.1.0 1.19.2 yarn

Registers a new Recipe Serializer.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • serializer_instance: The instance of the Recipe Serializer class.

Returns: The registered data.


RegisterRecipeType(String name, String Modid, RecipeType type_instance)

1.1.0 1.19.2 yarn

Registers a new Recipe Type.

Parameters:

  • name: The name (ID).
  • Modid: The Mod ID of the registrar.
  • type_instance: The instance of the Recipe Type class.

Returns: The registered data.


SimpleRegister(IRegistryType type, String Modid, Object... args)

1.0.0

Sends data to the modloader to register an object for Minecraft.

Parameters:

  • type: The type of registration.
  • Modid: The Mod ID of the registrar.
  • args: The arguments needed to register the object.

Returns: The registered data.


SimpleRegister(UUID type, String Modid, Object... args)

1.0.0

Sends data to the modloader to register an object for Minecraft.

Info

Using this function is highly discouraged unless you have a deep understanding of its inner workings.

Parameters:

  • type: The type of registration.
  • Modid: The Mod ID of the registrar.
  • args: The arguments needed to register the object.

Returns: The registered data.