Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.1] Blocks still dropping items despite mining them with the wrong mining level/tool?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Sconed

[1.16.1] Blocks still dropping items despite mining them with the wrong mining level/tool?

By Sconed, July 2, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Sconed    0

Sconed

Sconed    0

  • Tree Puncher
  • Sconed
  • Members
  • 0
  • 2 posts
Posted July 2, 2020

While I was creating a mod, I noticed that my mod's blocks harvest levels were all being set to zero, despite me defining them in the block's properties. 

 

So I did a clean install of the latest MDK (Forge 1.16.1-32.0.39), and made a quick test just to see if something else was causing it, but I haven't been able to figure out what's making this happen yet.

 

Here's what the code from my testing looks like:

@Mod("examplemod")
public class ExampleMod
{
    // Directly reference a log4j logger.
    private static final Logger LOGGER = LogManager.getLogger();

    private static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, "examplemod");
    
    public static final RegistryObject<Block> HARD_BLOCK = BLOCKS.register("coolblockname", () -> new Block(
        Block.Properties.create(Material.ROCK)
        .harvestLevel(3)
        .harvestTool(ToolType.PICKAXE)
        .hardnessAndResistance(2.5F, 10F)
    ));

    public ExampleMod() {
        IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
        BLOCKS.register(bus);

        MinecraftForge.EVENT_BUS.register(this);
    }
}

 

This is what the loot table for the block looks like:

{
    "type": "minecraft:block",
    "pools": [
      {
        "rolls": 1,
        "entries": [
          {
            "type": "minecraft:item",
            "name": "minecraft:carrot"
          }
        ],
        "conditions": [
          {
            "condition": "minecraft:survives_explosion"
          }
        ]
      }
    ]
  }

 

Lastly, here's a quick video of me showing that the block does still drop in game (despite the wrong mining level/tool)

 

If there's anything else that I can include to help diagnose the issue please let me know! Thanks

 

  • Quote

Share this post


Link to post
Share on other sites

ChampionAsh5357    160

ChampionAsh5357

ChampionAsh5357    160

  • World Shaper
  • ChampionAsh5357
  • Members
  • 160
  • 1017 posts
Posted July 2, 2020

harvestLevel and harvestTool still need to be re-evaluated. Until they are, implementations of these two methods will not work.

  • Quote

Share this post


Link to post
Share on other sites

Sconed    0

Sconed

Sconed    0

  • Tree Puncher
  • Sconed
  • Members
  • 0
  • 2 posts
Posted July 2, 2020
1 hour ago, ChampionAsh5357 said:

harvestLevel and harvestTool still need to be re-evaluated. Until they are, implementations of these two methods will not work.

Oh okay, thank you!

  • Quote

Share this post


Link to post
Share on other sites

Argmentum    0

Argmentum

Argmentum    0

  • Tree Puncher
  • Argmentum
  • Members
  • 0
  • 1 post
Posted July 3, 2020

This also seems to be failing on forge 1.15 .... following tutorials all the other ‘basic’ things work but this.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Lpoob
      Lobby

      By Lpoob · Posted 11 minutes ago

      dfdd
    • Montyfat
      Told me I have to choose which app to open it with?

      By Montyfat · Posted 33 minutes ago

      When I tried downloading forge I waited for 6 seconds for the skip button to pop up and when it did I pressed it and then it said "open with what app?" or something along the lines.I chose internet explorer since it was the only reasonable one. It gave me adobe, internet explorer, notepad, media player, and microsoft paint. I really am confused but at the same time also really want to download mods for minecraft. Please help!  P.S I did choose the correct version of MC (1.16.5) so don't ask about that 
    • SirStavros
      1.16.5 Forge Crashing On Start

      By SirStavros · Posted 47 minutes ago

      I have tried opening the latest version of forge but I can't seem to figure out why it keeps crashing. This has happened with previous versions as well. When I open it, after the crash it says this: An unexpected issue occured and the game has crashed. We're sorry for the inconvenience. Exit Code: 0 What do I need to do so that I can run it?
    • DaemonUmbra
      Why does Forge installer 1.8.9 have Vape as an execution parent?

      By DaemonUmbra · Posted 1 hour ago

      1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • DaemonUmbra
      Why don't you support 1.12.2?

      By DaemonUmbra · Posted 1 hour ago

      You can't expect us to support every version ever released ad infinitum. That doesn't sound like a valid reason to not upgrade, and if that is indeed your reasoning you would probably look at getting a better PC if you plan on playing games.
  • Topics

    • Lpoob
      0
      Lobby

      By Lpoob
      Started 11 minutes ago

    • Montyfat
      0
      Told me I have to choose which app to open it with?

      By Montyfat
      Started 33 minutes ago

    • SirStavros
      0
      1.16.5 Forge Crashing On Start

      By SirStavros
      Started 47 minutes ago

    • EthanDev
      1
      Why does Forge installer 1.8.9 have Vape as an execution parent?

      By EthanDev
      Started 1 hour ago

    • Amperka_pro
      1
      Why don't you support 1.12.2?

      By Amperka_pro
      Started 2 hours ago

  • Who's Online (See full list)

    • SSWarrior
    • Aecht_Rob
    • Cheezy Amuzus
    • Lpoob
    • TheUltimateGuide
    • Veo
    • HourShower
    • thorstenschwager
    • Luf1o
    • Chumbanotz
    • Montyfat
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.1] Blocks still dropping items despite mining them with the wrong mining level/tool?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community