Topic category: Help with Minecraft modding (Java Edition)
PLEASE ONLY ANSWER IF YOU KNOW THE ANSWER BECAUSE IT IS MORE LIKELY THAT YOU WILL SEE THIS IF THERE ARE NO USELESS ANSWERS
So I wanted to make a GUI and for testing, I made only 1 slot, in this slot I wanted to know if it's possible to specify only to accept certain items, so I first added a random block in the specification and then going to the code and deleting it, then I tried adding the stuff I want to specify where the random block was (and yes I did Import all of the items and delete completely the other block). And because it didn't work, I was wondering if there's a way to do it with procedures or just coding, maybe I did it wrong. By the way, I'm in 2021.1, Minecraft Version 1.16.
(If anyone didn't understand what I meant, here's an example: Imagine I want to only be able to put Gold, Diamond, Iron, Coal, etc on 1 slot, but I can't put other items like dirt or other things. And yes MCreator does let me specify items per slot, but it only lets me specify 1 item, when I want to specify at least 10.)
man please help
hm?
Show me your procedure.
that's the point, I don't have one, I don't even know where to start.
Off the top ofy head I can't think of a way to block items but you can make only do things if certain things are in the slot. For example
If slot 0 = diamond do blank
Then another if statement
If slot 0 = gold do blank and so on
If you do blank is pretty much the same like if diamond make weapon more op and with gold still on but less then diamond. Then make your 1st if statement the copy it and change what you need
If they add dirt nothing will happen
Sorry. Typed that on my phone and fat fingered the hell out of it
first of all, it is not a block but an item, and it works like a chest not a crafting table
I want to make a storage where you can only place for example, Tag Log
(just an example)
I think I didn't explain myself correctly, so imagine I have an item named Portable Ore Chest and I want it to only be able to put Diamond/Iron/Gold/Redstone/Lapiz, how would I do that
Off the top of my head maybe if the item in the slot is not diamond or whatever then return it to your inventory
that would work, but that would look kinda Nooby, if I find a way to put tags through code, that would look 10x better
Trying to figure it as well, i really don't know anything about java but when you limit the slot to a certain item, the code add :
So maybe we can copy that line and only allow certain item this way ? I gotta go to work i'll try once i get home
1 - Open your GUI
2- Add a slot with a limited item ex : Coal_ore
3- Save mod element
4- Go to your workspace, rightclick your GUI --> Open mod element in code editor
5- Should be the first option (TheNameOfYourGUIMenu.java)
With that, If someone is online while i'm not, might be able to figure it out. Thanks ! Hope this will help me as well xD