Mystic Development
  • Home
  • License
  • FarmHunt
    • How to install
    • API
  • awLootbox
    • How to install
    • Configuration
      • Config.yml
      • Lootbox.yml
    • Animations
      • Sounds
      • Particles
      • Effects
      • Armor Stands
        • Individual
        • Group
      • Steps
        • Movement
        • ArmorStands
        • Others
Powered by GitBook
On this page
  • Events
  • Managers
  • Coins
  • Game
  1. FarmHunt

API

  1. Install "FarmHuntAPI" in your pom.xml

<!--FarmHunt-API-->
<dependency>
    <groupId>internal</groupId>
    <artifactId>farmhunt</artifactId>
    <version>1.0</version>
    <scope>system</scope>
    <systemPath>${pom.basedir}/libs/FarmHuntAPI.jar</systemPath>
</dependency>
  1. Install "FarmHuntAPI" in your plugins Folder.

  2. Use:

FarmHuntAPI FHAPI = FarmHuntAPI.getInstance();

Events

FarmHuntWinGameEvent
FarmHuntLostGameEvent
FarmHuntPlayerDisguiseEvent
FarmHuntPlayerKillEvent
FarmHuntPlayerDeathEvent
FarmHuntPlayerJoinGameEvent
FarmHuntPlayerQuitGameEvent

Managers

Coins

    /**
     * Add coins to a player's account
     * @param player Target player
     * @param coins Amount of coins to add
     */
FHAPI.addCoins(Player player, int coins)

    /**
     * Remove coins from a player's account
     * @param player Target player
     * @param coins Amount of coins to remove
     */
FHAPI.removeCoins(Player player, int coins)
    /**
     * Set a player's coin balance
     * @param player Target player
     * @param coins New coin balance
     */
FHAPI.setCoins(Player player, int coins)
    /**
     * Reset a player's coins to zero
     * @param player Target player
     */
FHAPI.resetCoins(Player player)

Game

    /**
     * Send a player to a game
     * @param player Target player
     * @param gameName Name of the game (optional)
     */
FHAPI.joinPlayerToGame(Player player, String name)

    /**
     * Quit a player from a game
     * @param player Target player
     */
FHAPI.quitPlayerGame(Player player)

    /**
     * Get the player game.
     * @param player Target player
     */
FHAPI.getPlayerGame(Player player)

- getGameStatus() # setGameStatus()
- getName() # setName()
- getTimeRemaing() # setTimeRemaing()
- getCurrentPlaying() # setCurrentPlaying()
- getHunterPlayers() # setHunterPlayers
- getHuntedPlayers() # setHuntedPlayers
- getGameWinner() # setGameWinner()

GameStatus

There are several types of game states, here is a list that explains each one.

GameStatus.WAITING: This is the situation when there are players waiting 
in the waiting room, and the game has not yet started.

GameStatus.STARTING: This is the situation when there are players waiting in 
the waiting room, and the game is already complete to start!

GameStatus.STARTED: This is the situation when the game has already started.

GameStatus.FINISHED: This is the situation when the game is over.

GameStatus.NONE: When a status has not yet been assigned.
PreviousHow to installNextHow to install

Last updated 5 months ago