Interface PlayerLocales


public interface PlayerLocales
API for working with player locales.
Since:
4.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    An event called when a player locale update is received.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final @NotNull net.fabricmc.fabric.api.event.Event<PlayerLocales.Changed>
    Registration for PlayerLocales.Changed.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull Locale
    locale(@NotNull net.minecraft.world.entity.player.Player player)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use pointer instead, player.get(Identity.LOCALE).orElse(Locale.getDefault()) on a server or client player
  • Field Details

  • Method Details

    • locale

      @Deprecated(forRemoval=true, since="5.3.0") @NotNull static @NotNull Locale locale(@NotNull @NotNull net.minecraft.world.entity.player.Player player)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use pointer instead, player.get(Identity.LOCALE).orElse(Locale.getDefault()) on a server or client player
      Get the active locale for a player, either on the server or client sides.

      Will return the system-wide default value if the player has no locale set.

      Parameters:
      player - the source of the locale
      Returns:
      player locale
      Since:
      4.0.0