Hey guys. So im in need of a little help in creating custom inventories. So basically what I want to do is make it so when you run a command, it will save your previous inventory and open up the new one for that command. Example: run /sheep: saves default inventory, opens Sheep inventory run /cow: saves sheep inventory, opens the default inventory. Sorry if that isnt clear enough. basically what I want is multiple inventories with the previous ones saved. NOTE*** THIS IS NOT A PLUGIN REQUEST! I WANT TO BE SHOWN SOME CODE SO I CAN DO IT ON MY OWN.
@Takedown The point of the Plugin Development section is to get help on code you already have. Nobody is going to write code for you, that you just claim as your own. If you really want someone else to write code for you, then go to the requests section.
@Takedown An idea would be to use a hashmap<UUID, PlayerInventory> and to just swap the inventory using multiple variables. I haven't messed around to much with inventories so the probably is a better method to do this.
Yes, this section is to get help with code. I want to be shown how to start it off so I can continue on, I already said that I dont want someone to make me a plugin, I just need some help with creating it
@Takedown So you want someone to write code for you? Here, I'll start you off: Code: public class Main extends JavaPlugin { public void onEnable() { //Completely useless as of now } public void onDisabe() { //Completely useless as of now } }
@Takedown He is helping you. Now no one will spoofeed you code, so for the inventory saving store in a hashmap. As was said before. Commands are also pretty self explanatory, on the certain one save or get the inventory.