Class AmmunitionUtil

java.lang.Object
com.github.imdabigboss.easydatapack.api.utils.AmmunitionUtil

public class AmmunitionUtil extends Object
Some utilities for ammunition.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    usePlayerAmo​(@NonNull org.bukkit.entity.Player player, int customModelData)
    Checks if a player has an item with the given custom model data and removes one from the player's inventory.
    static boolean
    usePlayerAmo​(@NonNull org.bukkit.entity.Player player, @NonNull org.bukkit.Material material)
    Checks if a player has an item with the given material and removes one from the player's inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AmmunitionUtil

      public AmmunitionUtil()
  • Method Details

    • usePlayerAmo

      public static boolean usePlayerAmo(@NonNull org.bukkit.entity.Player player, int customModelData)
      Checks if a player has an item with the given custom model data and removes one from the player's inventory.
      Parameters:
      player - the player
      customModelData - the custom model data
      Returns:
      true if the player had the item, false otherwise
    • usePlayerAmo

      public static boolean usePlayerAmo(@NonNull org.bukkit.entity.Player player, @NonNull org.bukkit.Material material)
      Checks if a player has an item with the given material and removes one from the player's inventory.
      Parameters:
      player - the player
      material - the material
      Returns:
      true if the player had the item, false otherwise