Skip to content

IPlayerMeta

Namespace Mc.Scripting.Services · Kind interface

public interface IPlayerMeta

Player meta and affixes: the prefix, suffix and typed values that a permission provider (or any plugin) supplies for a player, read by the chat, tab and nametag plugins. Registered with ServiceManager; the highest-priority provider answers. Thread: tick thread.

Ramjet’s first-party permissions plugin implements it; without one, a built-in provider answers with no meta and no affixes. Contexts (a world, a server) are not part of this contract yet: a provider that needs them offers its own interface.

Member Description
IReadOnlyList<Affix> Affixes(Uuid player, AffixKind kind) The prefixes or suffixes of a player, highest weight first.
bool TryGet<T>(Uuid player, MetaKey<T?> key, out T? value) The value of a meta key for a player, from the provider’s highest layer that has it.
IReadOnlyList<Affix> Affixes(Uuid player, AffixKind kind)

The prefixes or suffixes of a player, highest weight first.

Parameters

Name Type Description
player Uuid The player.
kind AffixKind Prefixes or suffixes.

Returns IReadOnlyList<Affix>: The affixes (empty when there are none).

bool TryGet<T>(Uuid player, MetaKey<T?> key, out T? value)

The value of a meta key for a player, from the provider’s highest layer that has it.

Type parameters

  • T: The value type of the key.

Parameters

Name Type Description
player Uuid The player (online or offline).
key MetaKey<T?> The key.
value out T? The value when found; the default otherwise.

Returns bool: Whether the player has a value for the key.

Member Description
event Action<Uuid?>? Changed Raised when a player’s meta or affixes changed (tick thread).
public event Action<Uuid?>? Changed;

Raised when a player’s meta or affixes changed (tick thread). A null uuid means every player may have changed.

Returns Action<Uuid?>?

Affix · AffixKind · Uuid