Interface PlayerLocales
public interface PlayerLocales
API for working with player locales.
- Since:
- 4.0.0
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An event called when a player locale update is received. -
Field Summary
Modifier and TypeFieldDescriptionstatic final @NotNull net.fabricmc.fabric.api.event.Event<PlayerLocales.Changed>
Registration forPlayerLocales.Changed
. -
Method Summary
-
Field Details
-
CHANGED_EVENT
@NotNull static final @NotNull net.fabricmc.fabric.api.event.Event<PlayerLocales.Changed> CHANGED_EVENTRegistration forPlayerLocales.Changed
.- Since:
- 4.0.0
-
-
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 playerGet 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
-
player.get(Identity.LOCALE).orElse(Locale.getDefault())
on a server or client player