Class RegistryEvent.InfoSlotRegistryEvent

Enclosing class:
RegistryEvent

public static class RegistryEvent.InfoSlotRegistryEvent extends RegistryEvent
Used for creating your own info slots. This event is fired before the RegistryEvent.OptionsRegistryEvent as the info slots are need for the configs.
  • Constructor Details

  • Method Details

    • register

      public void register(String modId, String key, long updateTime, Supplier<String> supplier)
      Registers an infoslot.

      Please supply a key.tooltip in your lang files so that the dropdown item has a tool tip.

      Parameters:
      modId - - The ModId
      key - - The i18n key or Label for the InfoSlot dropdown in the options menu.
      updateTime - - How often in milliseconds to update.
      supplier - - The supplier that gets the value to be displayed.
    • register

      public void register(String modId, net.minecraft.network.chat.Component key, long updateTime, Supplier<net.minecraft.network.chat.Component> supplier)
      Registers an infoslot.

      Please supply a key.tooltip in your lang files so that the dropdown item has a tool tip.

      For key please use Component.translateable("key") here will also only render as white and does not support param arguments at this time. In the future, the dropdown will fully support Components and formatting.

      Parameters:
      modId - - The ModId
      key - - The i18n key for the InfoSlot dropdown in the options menu.
      updateTime - - How often in milliseconds to update.
      supplier - - The supplier that gets the value to be displayed.