Solved Minecraft Version Test

Discussion in 'Spigot Plugin Development' started by Helcostr, Oct 13, 2018.

  1. I am trying to make tattered books in 1.8 (they were released in 1.9, so obviously it will error). What is the best way to prevent this and create an original book instead?
     
  2. Code (Java):
    BookMeta bd = (BookMeta) this.getItemMeta();
    //...
    try {
       Class.forName("org.bukkit.inventory.meta.BookMeta.Generation");
       bd.setGeneration(Generation.TATTERED);
    } catch (ClassNotFoundException e) {}
     
    • Like Like x 1

Share This Page