Started by
Coliop
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, I've made custom leave blocks for custom trees (I'm creating a mod with brand new trees including new wood/log blocks and new leave blocks), and I'm wondering how I could make them being dropped by only using shears, like with vanilla leave blocks in vanilla trees. I've found the loot table technique but I can't control what tool can be used so I'm not satisfied with that, hence why I'm asking.
Thanks for your help!
create the loot table as usual, however leave the actual table itself blank. You can then go to this, and create the loot table (remember modid:itemid , not just itemid). Finally, edit the code and paste in the loot table, than save
Excuse myself, could you be more specific? I'm not familiar with the website you've given, I get that I have to copy paste the given code in Mcreator but I'm a bit lost with how the different tabs work. Also I don't understand how I can edit the code itself in the code viewer option in Mcreator
make the procedure? like, on right click, if player has item in hand, then destroy block + spawn gem (whatever you need) or drop block.
in any other case cancel the procedure that triggered it
also to edit code itself you should right-click the ELEMENT containing the code and edit, then lock it for mcreator to save from overriding.
The website Sayne has provided is useful for generating loot tables (and other stuff). It has many options that MCreator doesn't support. What you can do on that web page is load a template (button near the top) for some kind of leaves block, look at how it's structured, and change around stuff you don't want.
For shears-checking you want to look at the condition "minecraft:match_tool". Overall I recommend checking some tutorials about how the code here is structured, it's quite useful, and not too hard to grasp.
Also editing the code of an element in MCreator involves "locking" the code so the MCreator can't change it each time it tries to gradle. There is a button for that on the left, after that the element should be opening in the code editor instead of the graphical one.