Skip to content

ItemHandler

pixelrider2000 edited this page Sep 15, 2021 · 6 revisions
  • isAmmo(int itemID)

    Explanation: Checks if an item with the given item id is ItemBullet

    • itemID : ID of the item
  • isGun(int itemID)

    Explanation: Checks if an item with the given item id is ItemGun

    • itemID : ID of the item
  • getAllAmmoForGun(int itemID)

    Explanation: Returns a list of all ammo items (as IDs) that a gun can load

    • itemID : ID of the gun
  • getMaxAmmoItems(int itemID)

    Explanation: Returns how many individual ammo items a gun can hold

    • itemID : ID of the gun
  • getMaxRounds(int itemID)

    Explanation: Returns how many rounds a given ammo can hold

    • itemID : ID of the bullet
  • setAmmoAmount(String playerName, int slotOfGun, int rounds, int maxSeperateMagazines)

    Explanation: Sets the ammo of a given gun to set value

    • playerName : name of the player that
    • slotOfGun : slot in the player's inventory where the gun is located
    • rounds : number of rounds to which the ammo will be reduced (if set to -1, ammo will be full)
    • maxSeperateMagazines : (for guns that can hold multiple magazines: e.g. grenade launchers or shotguns) maximum amount of individual magazines inside the gun (if set to -1, the gun will be full)

Clone this wiki locally