Class Owner

java.lang.Object
net.citizensnpcs.api.trait.Trait
net.citizensnpcs.api.trait.trait.Owner
All Implemented Interfaces:
Runnable, Listener

public class Owner extends Trait
Represents the owner of an NPC.
  • Constructor Details

    • Owner

      public Owner()
  • Method Details

    • getOwner

      @Deprecated public String getOwner()
      Deprecated.
      Gets the owner.
      Returns:
      "SERVER" or the UUID string
    • getOwnerId

      public UUID getOwnerId()
      Returns:
      The owner's UUID, or null if the owner is the server or a UUID has not been collected for the owner.
    • isOwnedBy

      public boolean isOwnedBy(CommandSender sender)
      Gets if the given CommandSender is the owner of an NPC.
      Parameters:
      sender - Sender to check
      Returns:
      Whether the sender is the owner of an NPC
    • isOwnedBy

      public boolean isOwnedBy(String name)
    • isOwnedBy

      public boolean isOwnedBy(UUID other)
    • setOwner

      public void setOwner(CommandSender sender)
    • setOwner

      @Deprecated public void setOwner(String owner)
      Deprecated.
      Sets the owner of an NPC.
      Parameters:
      owner - Name of the player to set as owner of an NPC
    • setOwner

      @Deprecated public void setOwner(String owner, UUID uuid)
      Deprecated.
      Sets the owner of an NPC.
      Parameters:
      owner - Name of the owner
      uuid - UUID of the owner
    • setOwner

      public void setOwner(UUID uuid)
    • toString

      public String toString()
      Overrides:
      toString in class Object