Search the Community
Showing results for '"require tool"' in topics.
-
Unable to set Required Tool Type for Custom Block [1.17.1]
poopoodice replied to TheBeefBai's topic in Modder Support
Have a look at vanilla usage: requiresCorrectToolForDrops() Also check this out https://forums.minecraftforge.net/search/?&q=require tool&type=forums_topic&search_and_or=or&sortby=relevancy you need to add them to the block tags. @Luis_ST explained a lot in these posts... -
Yeah, you didn't use it right :\ Any conditional statements you want to use have to be involved in the logic of the result, otherwise it is totally wasted. Look: if (can player harvest and player has a pickaxe) { // here's your result: add level; } if (material doesn't require tool) { do nothing... // but your result has already finished... } Does that make sense? You have to use the if statement as a pre-condition for your result, i.e. put it INSIDE of the other if statement. You could also check if the material does not NOT need a tool, meaning it does need a tool... if (can harvest and pickaxe stuff) { if (!block.getMaterial().isToolNotRequired()) { // it doesn't not not need a tool: double-negative is positive, so it DOES need a tool // great! add your xp } }