Class BukkitUnsafe

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

public class BukkitUnsafe extends Object
Contains helpers for Bukkit's not so safe stuff.
  • Constructor Details

    • BukkitUnsafe

      public BukkitUnsafe()
  • Method Details

    • getMaterialFromMinecraftId

      @Deprecated @Nullable public static @Nullable org.bukkit.Material getMaterialFromMinecraftId(String id)
      Deprecated.
      Prefer getMaterialFromNamespacedId(String) for including modded item support
      Get a material from a minecraft id.
      Parameters:
      id - Namespaced ID with or without a namespace. IDs without a namespace will be treated as minecraft namespaced IDs. ('minecraft:dirt' and 'dirt' are equivalent.)
      Returns:
      The Material which the id represents, or null if no material can be matched.
    • getMaterialFromNamespacedId

      @Nullable public static @Nullable org.bukkit.Material getMaterialFromNamespacedId(String id)
      Get a material from a namespaced ID. For example, 'minecraft:iron_ingot' -> Material.IRON_INGOT; 'mod:an_item' -> Material.MOD_AN_ITEM
      Parameters:
      id - Namespaced ID with or without a namespace. IDs without a namespace will be treated as minecraft namespaced IDs. ('minecraft:dirt' and 'dirt' are equivalent.)
      Returns:
      The Material which the id represents, or null if no material can be matched.
    • modifyItemStack

      public static void modifyItemStack(org.bukkit.inventory.ItemStack stack, String arguments)
    • getMaterialFromId

      @Nullable public static @Nullable org.bukkit.Material getMaterialFromId(int id)