Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by jonaskohl

  1. I want to add a recipe to my mod that has a block (let's say wooden planks) and a vanilla tool (let's say an axe) and I want the axe to loose durability when used in crafting. This is what I got so far (inside of ModRecipeProvider#registerRecipes): Ingredient axeIngredients = Ingredient.fromItems( () -> Items.WOODEN_AXE, () -> Items.STONE_AXE, () -> Items.GOLDEN_AXE, () -> Items.IRON_AXE, () -> Items.DIAMOND_AXE, () -> Items.NETHERITE_AXE ); ShapelessRecipeBuilder.shapelessRecipe(ModBlocks.CHIPPED_OAK_PLANK.get()) .addIngredient(Blocks.OAK_PLANKS) .addIngredient(axeIngredients) .addCriterion("has_plank", hasItem(Blocks.OAK_PLANKS)) .build(consumer); However, this will consume the axe completely when crafted. How can I make the axe stay inside of the crafting grid and lose one point of durability? (Forge 1.16)
  2. I am using the following snippet inside of an onBlockClicked event listener to strip a custom log. Everything works as expected, except the axe doesn't "swing" as it does with vanilla blocks. It just does nothing. I tried using playerentity.swingArm(event.getHand()); but that does absolutely nothing. How can I achieve a swinging tool?
  3. In my mod I have several custom flower types (instances of FlowerBlock), which I register using the DeferredRegister. Now I want to add them to the composter's registry of compostable items. I know I need to add them to ComposterBlock.CHANCES, but I don't know when exactly I need to do this. When I call ComposterBlock.CHANCES.put() in my mod's main class's constructor, I get a NullPointerException with the message 'Registry Object not present: my_mod:my_flower', even though I created the flower objects before I tried to register them. I suspect I need to call this at a later time, but I couldn't find any information about this anywhere.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.