How to make custom leaves be obtained via shears and nothing else

Started by Coliop on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make custom leaves be obtained via shears and nothing else

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!

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
create the loot table as…
Fri, 06/16/2023 - 14:52

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

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Excuse myself, could you be…
Fri, 06/16/2023 - 18:20

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

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make the procedure? like, on…
Fri, 06/16/2023 - 19:53

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

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
also to edit code itself you…
Fri, 06/16/2023 - 20:03

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.

Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The website Sayne has…
Fri, 06/16/2023 - 20:07

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.