Class CustomPlayer

java.lang.Object
dev.lone.itemsadder.api.CustomEntity
dev.lone.itemsadder.api.CustomPlayer

public class CustomPlayer extends CustomEntity
Wrapper for a custom player entity and player emote helpers.
  • Method Details

    • getPlayerName

      public String getPlayerName()
      Gets the skin/player name used to spawn this custom player.
      Returns:
      the player name or skin identifier.
    • playAnimation

      public boolean playAnimation(String emoteName)
      Plays an emote animation on this custom player.
      Overrides:
      playAnimation in class CustomEntity
      Parameters:
      emoteName - the emote animation name.
      Returns:
      true if the animation was started.
    • stopAnimation

      public void stopAnimation()
      Stops the current animation on this custom player.
      Overrides:
      stopAnimation in class CustomEntity
    • spawn

      public static CustomPlayer spawn(String playerSkin, Location location)
      Spawns a custom player entity
      Parameters:
      playerSkin - can be a player name, a mineskin.org url and a signed texture string.
      location - the location where you want to spawn the entity
      Returns:
      the entity wrapper
    • byAlreadySpawned

      @Nullable public static @Nullable CustomPlayer byAlreadySpawned(Entity entity)
      Gets a custom player wrapper from an already spawned entity.
      Parameters:
      entity - the Bukkit entity to check.
      Returns:
      the custom player wrapper, or null if the entity is not a custom player.
    • playEmote

      public static void playEmote(Player player, String emoteName)
      Plays an emote on a real player.
      Parameters:
      player - the player.
      emoteName - the emote animation name.
    • stopEmote

      public static void stopEmote(Player player)
      Stops the current emote played by a real player.
      Parameters:
      player - the player.