Player Tame Amount?

Discussion in 'Plugin Development' started by XDemonic25, Mar 5, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    XDemonic25

    Is there a way to know how many pets (Wolves) a player has that is currently alive?

    I'm trying to find a way to prevent more than 2 pets on specific players in my plugin.
     
  2. I could be very wrong here but you can get a list of every entity, look through them looking for wolves, then check if the wolf is tamed (org.bukkit.entity.Tameable.isTamed).

    If it's tamed then look at the owner (org.bukkit.entity.Tameable.getOwner) and check how it compares to the player you're interested in. Count them up, if it's less than a certain amount they can tame the new wolf.

    Might be an easier method..
     
  3. Offline

    RealDope

    Nope, you're right. No easier method. Player objects don't store pets, pet objects store owners.
     
Thread Status:
Not open for further replies.

Share This Page