Right click block then open menu

Discussion in 'Spigot Plugin Development' started by ItssTycho, May 8, 2017.

  1. So, ive been trying this for a few hours and i came up with this:

    - https://pastebin.com/2BPHReGJ

    But if I right click the glowstone it doesn't show the menu.. and I dont seem to understand what I did wrong here.

    PS: Im a learning coder so it's probably a rookie mistake.
     
  2. You're making an instance of "Menu", what is that? Is that a custom class, because I don't see the
    org.bukkit.inventory.Inventory import. Are you just trying to make an inventory to open up?

    If so: the Bukkit.createInventory takes three parameters, the "owner", the "size" (multiples of 9), and the "name".
     
  3. https://pastebin.com/NWVxwQTP This is the menu class, im making en extern inventory where you can change your gamemode in, now im just testing out with blocks.
     
  4. Okay, any errors in console when you right click the block? Or does it just not come up period? If it doesn't come up at all with no errors it's probably a conditional thing.
     
  5. Ah I see, It doesn't load in at all in the console and also doesn't show up at /plugins.. But why?
     
  6. I would visit the console again for that :) Usually it would say something along the lines of "[insertpluginnamehere] plugin.yml is broken bla bla bla", what could be happening is when you build your plugin, you're not including your plugin.yml in the build. It is mandatory to have it in order for it to run. Make sure you're not using tabs when you make it, and it should look something along the lines of this.

    Code (Text):
    name: DankName
    version: 0.1
    main: yourpackagename.mainclassname
    commands:
      experience:
        usage: /experience <integer>
        description: Allows you to check the leaderboards for the
    EDIT: Obviously you don't need the commands section if you're not using it, but as an example I put it up there.