Couple more things I need to know how to do :
Change odds of a block dropping an item (e.g. : leaves dropping sticks)
Make a block that drops itself break and drop items instead (e.g. : wood logs into wood chunks)
Never mind sorry, very noob reply from me. It's been awhile since I've messed with Java so I am rusty. I have it working as I wanted, only shovels dig dirt, only axes chop wood, etc.
Thanks to all in thread that helped.
Now if you can help me here too that would be great ?
It checks whether the given Block can be harvested using the specified ItemStack. Using it as a check, only pick axes work with stone and such as intended. But nothing else is harvest-able, no matter what tool is used.
Yes I see this, thank you.
Thanks, I have seen the canHarvestBlock method but it's not quite what I want. I want to actually make it so that the blocks only break with the appropriate tool, unless its something like a flower / bush which should be breakable with anything.
I know how to check the tool type of a block with this :
event.getState().isToolEffective(ToolType.AXE)
But I am struggling with how to compare that to what's being held :
event.getEntityPlayer().getHeldItem(Hand.MAIN_HAND).getItem().
Works like a charm. But with this I can still break blocks if I have a flower or anything else in the player's hand. What I intend is to only be able to break blocks with the correct tool (shovel for dirt, axe for wood, etc.)
1.14.4. Also getItem() method looks like this :
return this.isEmpty || this.delegate == null ? Items.AIR : this.delegate.get();
isEmpty would be useful of course, but's its a private boolean variable....
I figured out events and what not, but I am having trouble doing an if statement check for whether the player is holding an item,
@SubscribeEvent
public void breakSpeed(BreakSpeed event) {
event.setNewSpeed(0);
}
I don't how to check for that exactly.
I have forge 1.14.4 and I have successfully set up my work space / project using gradle. I am able to use ./gradlew build to build mods which are placed in the libs folder, so everything definitely works. However I am not currently able to run the code from within Eclipse. I get "Error : Could not find or load main class GradleStart", from the console...
Main Class : GradleStart
Arguments –Guy=<Guy> –qwerty!=<qwerty!>