Is it possible: 3 slot inventory

Discussion in 'Plugin Development' started by sgavster, Nov 29, 2013.

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



    I was playing on a server, and I noticed that they had a 3 slot inventory! It was not Spout (I didn't have to use the spout client to connect). If someone knows how to to it, please let me know!

  2. Offline


    sgavster Maybe make a custom inventory event? And make so when they open their inventory it opens the custom one?
  3. Offline

    Windy Day

    Inventory ThreeSlotInv = Bukkit.createInventory(null, 3, "A Three Slot Inventory!");
    Where the first parameter is the owner, second the number of slots, and third the title. And if you want them to have it as their inventory, use an event like PolarCraft said and open the three slot one instead of their normal one.
  4. Offline


  5. Offline


    Maybe you can fill the other 6 with glass or whatever and cancel the event, if a player wants to take this ones.
    Otherwise you have to change these parts in CraftBukkit:
    1. public Inventory createInventory(InventoryHolder owner, int size) throws IllegalArgumentException {
    2. Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");
    3. return new CraftInventoryCustom(owner, size);
    4. }
    6. public Inventory createInventory(InventoryHolder owner, int size, String title) throws IllegalArgumentException {
    7. Validate.isTrue(size % 9 == 0, "Chests must have a size that is a multiple of 9!");
    8. return new CraftInventoryCustom(owner, size, title);
    9. }

    Of org.bukkit.craftbukkit.CraftServer
  6. Offline


    KingNyuels I do not want to do that. I would have done that if I wanted to.

    How would I 'change' it?.
  7. Offline


    sgavster Can you post a screen shot of the 3 slot inventory, because it might just be an illusion, or something, idk until I see
    Max_The_Link_Fan likes this.
  8. Offline


    Do you mean the other slots were unusable or they were just gone?
  9. Offline


    Do you mean the part with 'changing' the parts in CraftBukkit? Do you want a plugin just for your Server? Or for everyone. Then you cannot make it. Then will everyone who use this plugin have to change their CraftBukkit!

    Else you can Download the CraftBukkit repository from GitHub with Eclipse. Enable the Maven-Dependancy and modifie the parts. After that you have to compile this CraftBukkit-Version via Maven.

    If someone knows a better way: Tell it! - English is not my native language, so sometimes the translation is a little bit broken.

    PS: But it can be that the MC-Client crashes - I don't tested it
  10. Offline


    The closest thing I could come up with was a modified hopper inventory that was renamed:
    From my understanding this is the closest thing you can do, but as always I could be wrong..
  11. Offline


  12. Offline


  13. Offline


    No, he already said it was not.
  14. Offline


    sgavster Could you please post a screenshot of it or post the ip of the server?
  15. Offline


    The arrow is pointing at reply button ;p
  16. Offline


    DarkBladee12 They changed it, but the IP was: They used to have it though!
  17. Offline


    Perhaps it was just one of the minecraft bugs where the inventory slots change color.
  18. Offline


    It might be possible since 3 is a factor of 9 :3 But that might explain why I'm passing Math by 0 points :(
  19. Offline


  20. Offline


    What about dispensers? They have 3 rows of 3 slots. If you can use numbers divisible by 9 as slots into a chest system, I bet you can open a dispenser inventory and only set 1 row for it.
    maxben34 likes this.
  21. Offline


    Maulss The question is.. How o-o
  22. Offline


    Actually I think they used direct Minecraft code (NMS or something), I don't think CraftBukkit supports this.
  23. Offline



    It breaks every update too, if I'm correct, never used it :OOOOO
  24. Offline


    CraftBukkit is an NMS wrapper, how could it not work?
  25. Offline


    He probably meant the API.

    And I'm pretty much positive this isn't possible, unless there's some sort of little-known exploit I've never heard of. Are you sure it wasn't just a texture pack?
  26. Offline


    Post a screenshot
Thread Status:
Not open for further replies.

Share This Page