PluginBugs / Issues-ItemsAdder

Repository used to keep track of issues of my plugin ItemsAdder
https://itemsadder.devs.beer
53 stars 21 forks source link

Per tool block hardness #1268

Open The-Gust opened 2 years ago

The-Gust commented 2 years ago

Discord tag (optional)

Gust#1337

Describe the solution you'd like

Suggestion is simple - possibility to add different hardness level of blocks for tools.

Is your feature request related to a problem?

Suggestion based on a little "bug". When you break any block type - it's breaking with differently speed, axe and shovel breaks REAL_NOTE blocks much faster, than pickaxe, but hardness is the same for all tools types and here's not possible to make it different.

Describe alternatives you've considered

1) Make possibility to choose hardness only for groups of tools (- AXE, - PICKAXE, - SHOVEL, - SHEARS, etc):

    hardness_list:
    - PICKAXE:3
    - AXE:10   

2) Add for both, and for groups, and for every tool, which will looks familiar with whitelist/blacklist breaking tools in config:

    break_tools_blacklist:
    - WOODEN_PICKAXE
    break_tools_whitelist:
    - PICKAXE
    - pickax
    - AXE

    hardness_list:
    - DIAMOND_AXE:5
    - DIAMOND_PICKAXE:1
    - PICKAXE:3
    - AXE:10   
razorrider7 commented 2 years ago

Any chance this is going to be added? This feature would be amazing and is much needed for what I want to do with my server...

LoneDev6 commented 2 years ago

I think a dig seed multiplier for each custom item would be better.

Anyway why cannot you pre-enchant the item with DIG_SPEED? It's a more vanilla-like behaviour.

Yurinann commented 2 years ago

I think a dig seed multiplier for each custom item would be better.

Anyway why cannot you pre-enchant the item with DIG_SPEED? It's a more vanilla-like behaviour.

I saw #1033 , but in fact I still don't fully understand how this is achieved. Should I give each custom block its own new tool and add them when judging events to create their own way of judging hardness for each custom block?

If you can provide a more detailed example, thank you very much.

LoneDev6 commented 2 years ago

1033 example was achieved by creating an item which will apply FAST_DIGGING potion effect to the player when they hold the item and remove it once they un-hold it.

It's another approach but works good.

razorrider7 commented 1 year ago

1033 example was achieved by creating an item which will apply FAST_DIGGING potion effect to the player when they hold the item and remove it once they un-hold it. It's another approach but works good.

This would not resolve the issue. This would make ALL blocks break faster using that tool. What @Yurinann is asking for (correct me if I am wrong) is to allow giving specific custom blocks different hardness values when using tools, but leaving vanilla and other custom blocks with the same break speed as normal.

LoneDev6 commented 1 year ago

This is what @The-Gust suggested:

    break_tools_blacklist:
    - WOODEN_PICKAXE
    break_tools_whitelist:
    - PICKAXE
    - pickax
    - AXE

    hardness_list:
    - DIAMOND_AXE:5
    - DIAMOND_PICKAXE:1
    - PICKAXE:3
    - AXE:10   

This is what I'd write instead:

    break_conditions:
      DIAMOND_AXE:
        enabled: false
        tool: DIAMOND_AXE
        hardness: 2
      DIAMOND_PICKAXE:
        tool: DIAMOND_PICKAXE
        hardness: 1
      ruby_pickaxe:
        tool: "iasurvival:ruby_pickaxe"
        hardness: 0.5
      PICKAXE:
        tool: PICKAXE
        hardness: 3
      AXE:
        tool: AXE
        hardness: 10
      any_iasurvival_item:
        tool: "iasurvival:*"
        hardness: 3

So that in the future I might add some other rules and not only hardness.

What do you think?

razorrider7 commented 1 year ago

Looks great! Exactly what I have been wanting!

Vericen commented 1 year ago

Good afternoon, it hasn't been added yet, as far as I understand? Is there any way to fix the lack of this function with another plugin?