API PlayerManager - Nutty101/NPC-Police GitHub Wiki

Documentation

PlayerManager is a class that provides the ability to read, or modify many of the players settings inside of NPCPolice.

  • Author: Sir_Nutty (Bruce Johnson)
  • Since: 2.1.1

public CURRENT_STATUS getCurrentStatus()

This method provides access to the players current wanted status.

  • Returns: CURRENT_STATUS returns an enumeration flag that

    defined the users current status.

  • Since: 2.1.1

public CURRENT_STATUS getPriorStatus()

This method provides access to the players prior wanted status.

  • Returns: CURRENT_STATUS returns an enumeration flag that

    defined the users prior status.

  • Since: 2.1.1

public void setCurrentStatus(CURRENT_STATUS newStatus)

This method provides access to set the players current wanted status.

  • Parameters: newStatus — Set the players current wanted status

  • Since: 2.1.1

public Double getCurrentBounty()

This method provides the users current bounty value.

  • Returns: Double returns the current value of the users bounty

    level.

  • Since: 2.1.1

public void changeBounty(Double newBounty)

This method provides access to increase or decrease the users current bounty level
Use negative values to decrease the users bounty

  • Parameters: newBounty — Set the players current bounty level

  • Since: 2.1.1

public void clearBounty()

This method provides the ability to set the users bounty to 0

  • Since: 2.1.1

public void changeTime(int seconds)

This method provides access to increase or decrease the users current jail time (on top of bounty)
Use negative values to decrease the users time

  • Parameters: seconds — Set the players current bounty level

  • Since: 2.1.1

public int getTime()

This method provides access to increase or decrease the users current jail time (on top of bounty)
Use negative values to decrease the users time

  • Returns: Integer returns the current value of the users time

    value

  • Since: 2.1.1

public void setTime(int seconds)

This method provides access to set the users current jail time (on top of bounty)
This sets the value to a specific value

  • Parameters: seconds — Set the players current bounty level

  • Since: 2.1.1

public void clearWanted()

This method provides the ability to clear the users wanted level

  • Since: 2.1.1

public void addWantedReason(Wanted_Information wantedInfo)

This method provides the ability to add a new item to the users wanted reasons

  • Parameters: wantedInfo — Pass a wanted_information object to append to the users wanted

    reasons

  • Since: 2.1.1

public Date getLastArrest()

This method provides access to the users last date/time being arrested

  • Returns: Date returns a date object referencing the last

    system date that the user was arrested

  • Since: 2.1.1

public Date getLastEscape()

This method provides access to the users last date/time they escaped

  • Returns: Date returns a date object referencing the last

    system date that the user escaped

  • Since: 2.1.1

public void clearLockedInventory()

This method will clear a users locked up inventory. This is items that were confiscated at the time of arrest.

  • Since: 2.1.1

public void returnLockedInventory()

This method will return a users locked up inventory. This is items that were confiscated at the time of arrest.

  • Since: 2.1.1

public boolean hasLockedInventory()

This method will clear a users locked up inventory. This is items that were confiscated at the time of arrest.

  • Returns: true The player has items currently locked up in the

    jails inventory system

    false The player has no items pending in the jails

    inventory system

  • Since: 2.1.1

public Double distanceToJail()

This method will provide a squared distance to the closest configured jail

  • Returns: Double Number of blocks to the closest jail

  • Since: 2.1.1

public void arrestPlayer()

This method will send a player to the nearest configured jail

  • Since: 2.1.1

public void releasePlayer()

This method will release a player from jail

  • Since: 2.1.1

public Double getBountyPerSecond()

This method will return the number of bounty currently being awarded to this player per second
Negative numbers are lowering the users bounty, where as positive are adding onto it

  • Returns: Double Returns the number of bounty currently being

    awarded/subtracted per second to this player

  • Since: 2.1.1

public Double getBountPerSecond()

  • Deprecated
⚠️ **GitHub.com Fallback** ⚠️