Class BukkitUtils

java.lang.Object
ch.njol.skript.bukkitutil.BukkitUtils

public class BukkitUtils extends Object
Utility class with methods pertaining to Bukkit API
  • Constructor Details

    • BukkitUtils

      public BukkitUtils()
  • Method Details

    • registryExists

      public static boolean registryExists(String registry)
      Check if a registry exists
      Parameters:
      registry - Registry to check for (Fully qualified name of registry)
      Returns:
      True if registry exists else false
    • getPotionEffectTypeRegistry

      @Nullable public static @Nullable org.bukkit.Registry<org.bukkit.potion.PotionEffectType> getPotionEffectTypeRegistry()
      Get an instance of the PotionEffectType Registry

      Paper/Bukkit have 2 different names for the same registry.

      Returns:
      PotionEffectType Registry
    • getEquipmentSlotIndex

      public static Integer getEquipmentSlotIndex(org.bukkit.inventory.EquipmentSlot equipmentSlot)
      Get the inventory slot index of the EquipmentSlot
      Parameters:
      equipmentSlot - The equipment slot to get the index of
      Returns:
      The equipment slot index of the provided slot, otherwise null if invalid
    • getEquipmentSlotFromIndex

      public static org.bukkit.inventory.EquipmentSlot getEquipmentSlotFromIndex(int slotIndex)
      Get the EquipmentSlot represented by the inventory slot index
      Parameters:
      slotIndex - The index of the equipment slot
      Returns:
      The equipment slot the provided slot index, otherwise null if invalid