Enchanting Items that Usually Aren't Enchantable

Discussion in 'Plugin Development' started by NightTerror6, Sep 19, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    NightTerror6

    Hello, people that know more than me,
    I was attempting to write a plugin that would allow a player to put a piece of paper in an enchanting table, and be able to enchant it like any normal tool or book. I have a system for enchanted paper already, but I just want to be able to make paper into enchanted paper by using the table.
    Doable or not?

    Also, I'm having trouble creating Inventories that appear to a player on command, please give an example if you're willing.
     
    Last edited: Sep 19, 2017
  2. InventoryClickEvent and check if the paper is in the enchant table then get the ItemMeta of the paper and theres a addEnchant() method.
    As for the Inventory to create one you do:
    This will create a chest inventory, the size has to be a multiple of 9, so 9, 18, 27, 36
    Inventory inv = Bukkit.createInventory(null, size, title); or
    The first parameter is for the Inventory Holder if you don't want one just do null
    Inventory inv = Bukkit.createInventory(null, InventoryType.FURNACE, title);
     
  3. Offline

    NightTerror6

    Thanks, I'll try that, and as it turned out my inventory can't have a number of rows that isn't a multiple of nine lol
     
Thread Status:
Not open for further replies.

Share This Page