Quick Question

Status
This thread has been locked.

Torch

Banned
Feedback score
3
Posts
35
Reactions
22
Resources
0
I have a quick question regarding GUI's. I want to have GUI inventory's that you can move through by clicking the green glass pane and also save the items on close. I know how to switch inventories using the "createMenu" feature however with that when an inventory is closed it disregards the items inside. I have also tried to use the "openInventory" however I cant seem to link the openInventory to the itemMetas that I have set such as the green and grey panes, it just opens a blank inventory. How would I go about solving this?

Here's an example of what I'm going for:
02e70d0445298ce732e83abe6a4f9403.png
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Torch

Banned
Feedback score
3
Posts
35
Reactions
22
Resources
0
What? Are you trying to make a multi-page gui?
Yes but an inventory. A multi page GUI inventory. Rather than using the "createMenu" command which creates a GUI that resets on closing I am trying to create one using the "openInventory" command but I am having a difficult time adding the items at the bottom with the item meta for the inventory.

f7a378001f757f72ae73cdbd8b833799.png


Basically I need to turn the "public void createMenu1(Player player){" into a player.openInventory(inv1) however when I've tried that it doesn't work.
 
Banned forever. Reason: Ban Evading (Cade GOD)

Torch

Banned
Feedback score
3
Posts
35
Reactions
22
Resources
0
You clearly don't know very much java. I'd go back and learn it if I were you.
I do know Java as this has absolutely nothing to do with my Java knowledge... Maybe you aren't understanding my question. This only has to do with the usage of the Bukkit API, I know the correct usage of almost every GUI instance however I don't know how to link the inventory GUI.[DOUBLEPOST=1495587287][/DOUBLEPOST]When I use "createMenu" (Not a inventory GUI so gets rid of items inside)

https://gyazo.com/88503f84a9e24f5327f8a93bc62bf15a

When I use "player.openInventory(player); (I use it in the same way and receive no errors)"

https://gyazo.com/77d0c1d4f48695614a397e8fb7025174[DOUBLEPOST=1495587436][/DOUBLEPOST]
Not saying this isn't a good question, just saying you call it a 'public void' instead of a method which is a clear sign of this.
Whats wrong with me using public void...? Please explain, that's how many other GUI's are called from my extent of knowledge. I have 3 other GUI plugins using those and it works fine? Just because someone doesn't use the SAME methods as you doesn't mean they "Don't know Java" there is many different ways of doing the same thing, some work more efficiently than others.
 
Last edited:
Banned forever. Reason: Ban Evading (Cade GOD)

Torch

Banned
Feedback score
3
Posts
35
Reactions
22
Resources
0
Or maybe you don't get what I'm saying. You said that you used player.openInventory(player); How in the world would that work? And you don't even understand what a method is...
First off, it would work because "player" is what I set the inventory name to when I called it earlier on in the code... that's how you open GUI's :tup: Second off,
You said that you used player.openInventory(player); How in the world would that work?
That's the Bukkit API not Java and as I've said I'm still learning the Bukkit API. You are contradicting yourself, first you say I need to learn Java, then say my error happens due to a problem with Bukkit API? Please stop trying to point out things that aren't at all a problem. I asked for help and you clearly can't help me, you came on my thread and talked down to me as if I were inexperienced. Then when I correct you on each thing you pull up another "issue" with my code. First it was public void, then it turned into the Bukkit API code itself. You aren't helping me which is the whole reason I made this post so please just leave. I don't know why you commented in the first place if you could not provide help. Thank you. If any one could provide some useful information rather than picking on things that are irrelevant I am open to all ideas.[DOUBLEPOST=1495589850][/DOUBLEPOST]
You said that you used player.openInventory(player); How in the world would that work?
Rather than saying "How in the world would that work" You could've thought to yourself, maybe that's why I made this thread? Maybe I need help linking it because I'm not completely familiar with the Bukkit API?
 
Last edited:
Banned forever. Reason: Ban Evading (Cade GOD)

Torch

Banned
Feedback score
3
Posts
35
Reactions
22
Resources
0
You clearly have no idea what I'm saying so I won't bother.

Just create a new inventory if you want them to open another, and save the items in some sort of collection. No need to make a whole new method every time.
As I said if you're not going to help the issue I'm having don't respond. I'm not having problems creating new inventories, I have separate inventories already made. Just need help setting items inside the inventory for click events and itemMeta whilst using "player.openInventory" rather than using "menuCreate".
 
Banned forever. Reason: Ban Evading (Cade GOD)

Areeb

Supreme
Feedback score
41
Posts
1,251
Reactions
442
Resources
0
I suggest you to use ChestCommands
PM for help <3[DOUBLEPOST=1495645075][/DOUBLEPOST]Thom Seriously lol...[DOUBLEPOST=1495645119][/DOUBLEPOST]oh my bad should've read the post lol
 
Last edited:

Fudged

Premium
Feedback score
3
Posts
187
Reactions
93
Resources
0
I've never been more confused in my life?

You created an Inventory variable with the name player...

You say you know Java, but not the Bukkit API. However, this seems to be more of a Java question because you're going to need collections/lists of ItemStacks and such.

Can you please specify what your question/problem is exactly. Also, we need more code as one method will not be enough. I want to see what you've tried, and where you cannot seem to figure out what to do

Is this some sort of vault plugin?
 
Last edited:

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
Ask on spigot, you'll only get answers from skids and retards if you ask here.

Message me if you need help.[DOUBLEPOST=1495646778][/DOUBLEPOST]
I've never been more confused in my life?

You created an Inventory variable with the name player...

You say you know Java, but not the Bukkit API. However, this seems to be more of a Java question because you're going to need collections/lists of ItemStacks and such.

Can you please specify what your question/problem is exactly. Also, we need more code as one method will not be enough. I want to see what you've tried, and where you cannot seem to figure out what to do

Is this some sort of vault plugin?
Where did he make an inventory variable called "player"?
 
Last edited:

Fudged

Premium
Feedback score
3
Posts
187
Reactions
93
Resources
0
Ask on spigot, you'll only get answers from skids and retards if you ask here.

Message me if you need help.[DOUBLEPOST=1495646778][/DOUBLEPOST]
Where did he make an inventory variable called "player"?
First off, it would work because "player" is what I set the inventory name to when I called it earlier on in the code... that's how you open GUI's :tup: Second off

Thats the way I understood what he was saying, correct me if Im wrong :p
 

Eric

Software Engineer
Supreme
Feedback score
14
Posts
1,760
Reactions
1,648
Resources
1
Ask on spigot, you'll only get answers from skids and retards if you ask here.

Message me if you need help.[DOUBLEPOST=1495646778][/DOUBLEPOST]
Where did he make an inventory variable called "player"?
except Tyler and some others[DOUBLEPOST=1495651244][/DOUBLEPOST]
except Tyler and some others
lil shit tyler
 

Tyler

Developer
Supreme
Feedback score
14
Posts
2,589
Reactions
2,238
Resources
0
You could clear the one inventory and set the new items inside, so you don't have to create a bunch of inventories.
 
Status
This thread has been locked.
Top