> For the complete documentation index, see [llms.txt](https://d-ghinea.gitbook.io/royaleeconomy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://d-ghinea.gitbook.io/royaleeconomy/api/kill-coins.md).

# Kill Coins

These functions are found in **RoyaleEconomy.apiHandler.killCoins:**

**double getTotalCoins(Player p)** » returns the total amount of coins a player has gained from killing entities.

**double getCoinsForKey(Player p, String key)** and **double getCoinsForCustomKey(Player p, String customKey)** return the amount of coins for a specific key from the config.

**int getCountForKey(Player p, String key)** and **int getCountForCustomKey(Player p, String customKey)** return the amount of entities killed for a specific key from the config.

For the config below:

```yaml
  kill-events:
    #The list of entity types: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/EntityType.html
    event1:
      entity-type: 'PLAYER'
      #Permission to get coins from killing this entity
      #Set to none if u want everyone to be able to get coins
      permission: 'none'
      display-name: '&cPlayer'
      coins-to-give: '15'
      #After you kill the maximum number you
      #won't receive any more coins for killing this entity
      #set 0 for no limit
      maximum-kills: 1000
      maximum-reached-message:
        - '&cYou reached a maximum of kills!'
        - '&cYou won''t receive any more coins for killing players.'
        - ''
        - '&cYou will start to get coins again tomorrow!'
    event2:
      entity-type: 'ZOMBIE'
      #Permission to get coins from killing this entity
      #Set to none if u want everyone to be able to get coins
      permission: 'none'
      display-name: '&aZombie'
      coins-to-give: '5-10'
      #After you kill the maximum number you
      #won't receive any more coins for killing this entity
      #set 0 for no limit
      maximum-kills: 5000
      maximum-reached-message:
        - '&cYou reached a maximum of kills!'
        - '&cYou won''t receive any more coins for killing zombies.'
        - ''
        - '&cYou will start to get coins again tomorrow!'
    event3:
      entity-type: 'SKELETON'
      #Permission to get coins from killing this entity
      #Set to none if u want everyone to be able to get coins
      permission: 'none'
      display-name: '&fSkeleton'
      coins-to-give: '5-10'
      #After you kill the maximum number you
      #won't receive any more coins for killing this entity
      #set 0 for no limit
      maximum-kills: 5000
      maximum-reached-message:
        - '&cYou reached a maximum of kills!'
        - '&cYou won''t receive any more coins for killing skeletons.'
        - ''
        - '&cYou will start to get coins again tomorrow!'
  #kill events based on entity name
  #has priority over entity type
  custom-kill-events:
    event1:
      entity-name: '&aCustom Entity Name'
      #Permission to get coins from killing this entity
      #Set to none if u want everyone to be able to get coins
      permission: 'none'
      display-name: '&aCustom Entity'
      coins-to-give: '15'
      #After you kill the maximum number you
      #won't receive any more coins for killing this entity
      #set 0 for no limit
      maximum-kills: 1000
      maximum-reached-message:
        - '&cYou reached a maximum of kills!'
        - '&cYou won''t receive any more coins for killing custom entities.'
        - ''
        - '&cYou will start to get coins again tomorrow!'
```

You have the keys "event1", "event2" and "event3".\
You have the custom keys "event1".

```java
Player p = e.getPlayer();
//this returns the coins player p has got for killing other players
double playerKills = RoyaleEconomy.apiHandler.killCoins.getCoinsForKey(p, "event1");
```
