perromercenary00 Posted February 27, 2024 Posted February 27, 2024 im following this case coze removing the material class from the code fucks up mi items that depends on it i need to find a replacement for the Material class this is an old item from back 1.8 when turn on hold right click it checks the target block and if its made of wood it changes to cutting animation Material pmat = blkstate.getMaterial(); if (pmat == Material.WOOD){ //then cut it down } this other one checks for dirt or stone its no supposed to work on metal or wood what i could use ? Quote
vemerion Posted February 28, 2024 Posted February 28, 2024 9 hours ago, perromercenary00 said: what i could use ? You could use the BlockTags.MINEABLE_WITH_AXE tag. Quote
perromercenary00 Posted February 28, 2024 Author Posted February 28, 2024 sorry for the stuborn ness ss test code Spoiler if (!warudo.isClientSide && rp != null && can_do_it(helditem)) { dblkstate = rp.getBlockState(); String nnn = ForgeRegistries.BLOCKS.getKey(dblkstate.getBlock()).toString(); System.out.println("\n"); System.out.println("name " + nnn); if (dblkstate.canBeReplaced()) { System.out.println("blkstate.canBeReplaced()"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_AXE)) { System.out.println("BlockTags.MINEABLE_WITH_AXE"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_PICKAXE)) { System.out.println("BlockTags.MINEABLE_WITH_PICKAXE"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_SHOVEL)) { System.out.println("BlockTags.MINEABLE_WITH_SHOVEL"); } if (dblkstate.is(BlockTags.MINEABLE_WITH_HOE)) { System.out.println("BlockTags.MINEABLE_WITH_HOE"); } } name minecraft:grass_block BlockTags.MINEABLE_WITH_SHOVEL name minecraft:dirt BlockTags.MINEABLE_WITH_SHOVEL name minecraft:oak_log BlockTags.LOGS name minecraft:oak_planks BlockTags.PLANKS name minecraft:oak_leaves BlockTags.MINEABLE_WITH_HOE name minecraft:cobblestone_slab BlockTags.MINEABLE_WITH_PICKAXE name minecraft:stone BlockTags.MINEABLE_WITH_PICKAXE name minecraft:coal_block BlockTags.MINEABLE_WITH_PICKAXE logs and planks return nothing on minable but i can use the other tags name minecraft:oak_log BlockTags.LOGS name minecraft:oak_planks BlockTags.PLANKS it kinda works but its not like like perfect Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.