Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/20 in all areas

  1. Hello, I've set my mod block harvest tool to pickaxe and level to 1, which should cause it to drop nothing when mined with a wooden pickaxe. However this not only does not take place, but I'm even able to harvest the block by mining it with a bare hand. Code details Block registration: public static final RegistryObject<Block> COPPER_ORE = BLOCKS.register("copper_ore", MetalOreBlock::new); MetalOreBlock class: package ... import ... public class MetalOreBlock extends Block { public MetalOreBlock() { super(Block.Properties .create(Material.ROCK) .sound(SoundType.STONE) .hardnessAndResistance(3.0f, 3.0f) .harvestLevel(1) .harvestTool(ToolType.PICKAXE) ); } } How to fix it? Thanks in advance!
    1 point
  2. It's not I was just seeing if I could fit an entire mod in one class for fun I guess not, thanks for the help!
    1 point
  3. I'm afraid player capability is the only way to achieve this afaik. It is not as simple as storing the data in the fields in your event class (which won't work), but it is the only way I can think of. Also it is not so complicated isn't it?
    1 point
  4. Strange, because the PlayerLoggedInEvent fires for me when I log on to a dedicated server. What version are you running? And how are you registering your event listener?
    1 point
  5. 0 = none 1 = wood 2 = stone 3 = iron 4 = diamond
    1 point
  6. My block class look like this: package ... import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraftforge.common.ToolType; public class MetalBlock extends Block { public MetalBlock() { super(Block.Properties .create(Material.IRON) .sound(SoundType.METAL) .hardnessAndResistance(5.0f, 6.0f) .harvestLevel(1) .harvestTool(ToolType.PICKAXE) .setRequiresTool() //or func_235861_h_() ); } } and I'm mining it with vanilla tools. I haven't created any tools in my mod yet to test it out. Are you experiencing the problem with vanilla tools?
    1 point
  7. setRequiresTool() in AbstractBlock.Properties So canHarvestBlock() will do tool checking when block is harvest. You can also see how blocks in Blocks.java do it.
    1 point
  8. I'm using MDK version 32.0.75. Found solution: at [1.16.1] [SOLVED] Block drops not respecting harvest level and tooltype
    1 point
  9. 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    0 points
  10. Didn't seem to help Here's a pastebin link to the build output: https://pastebin.com/yhXVGCFL Heres another pastebin to my build.gradle: https://pastebin.com/ZgnH6rrm
    0 points
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.