Carpet

Carpet

2M Downloads

A way to find out which tool is best to mine some block

James103 opened this issue ยท 2 comments

commented

Currently (Carpet Mod 1.3.19 in MC 1.15.2), there appears to be no simple way to find out which tool is the best tool to mine a block. You could hardcode this data in your app, but you risk errors, slowdowns, and it being outdated compared to newer versions, in addition to having to include (and update) this data in all apps for which you need the feature for.

I would like if there was a new function tool(pos) that returns the preferred/required tool to break the block. The return value can be one of:

  • bucket (liquids)
  • axe (wooden items)
  • pickaxe (stone)
  • stone_pickaxe (iron)
  • iron_pickaxe (diamond)
  • diamond_pickaxe (obsidian)
  • shears (leaves, cobweb, wool)
  • shovel (dirt)
  • sword (bamboo)
  • hoe (1.16)
  • null (for blocks with no preferred tool)

Feel free to let me know about any existing working implementations that don't rely on manually-updated hardcoded data so that I can use them.

commented

hmm, code doesn't specify that exactly what is a preferred tool, just based on the user action calculates how long it would take and what the outcome is.
If such functionality is part of the API then it would be hardcoded and maintained in the API as it would be hardcoded and maintained in your app. To me, this sounds like a good example what the API shoudn't be doing and what would be the role of the app programmer.

Don't get me wrong - if the game would have a preference system I could expose if, but it doesn't have it.

Also the choice for that is no longer clear and subject to interpretation (leaves - hoe or shears, also pickaxe - always nethterrite is better, so stone_pickaxe preference is questionable)

commented

Closing, not needed. Can be implemented as an app function.