Interface MixinServerPlayer

All Superinterfaces:
ArmorEquipable, AttributeHolder, Audience, Carrier, Contextual, CopyableDataHolder, DataHolder, DataHolder.Mutable, DataSerializable, Entity, EntityProjectileSource, Equipable, HoverEventSource<HoverEvent.ShowEntity>, Humanoid, Identifiable, Identified, Living, LocaleSource, Locatable, Nameable, Player, Pointered, ProjectileSource, RandomProvider, SerializableDataHolder, SerializableDataHolder.Mutable, ServerPlayer, Sound.Emitter, Subject, Tamer, TeamMember, ValueContainer, Viewer

public interface MixinServerPlayer extends ServerPlayer
The interface provides additional options for player interaction such as:
* Sending a custom data packet.
* Send messages as a string or contained in the Text interface.
* Getting a list of player's mods if they are available and if the server uses Forge.

All existing methods in the ServerPlayer interface will still be available.
  • Method Details

    • cast

      static MixinServerPlayer cast(ServerPlayer player)
      Converting the type of the player class to get additional methods.
    • sendPacket

      void sendPacket(CustomPacket packet)
      Sending a data packet to the player.
    • sendMessage

      void sendMessage(Text message)
      Additional method for sending messages to a player.
      A placeholder will be automatically applied with the player's name substituted.
    • sendMessage

      void sendMessage(String message)
      Additional method for sending messages to a player.
      A placeholder will be automatically applied with the player's name substituted.
    • getModList

      List<String> getModList()
      Getting a list of mods from a player. Will work only on the server with Forge.
      If you have a vanilla server, the list will always be empty.
      The list will also be empty if the player has no mods.