xenondevs / Nova

Nova is a server-side modding framework for Paper servers that aims to streamline adding custom content like items, blocks, guis, and more, without client-side modifications, using resource pack tricks.
Other
371 stars 38 forks source link

Unbreakable block with tool #307

Closed CptbeffHeart closed 2 months ago

CptbeffHeart commented 11 months ago

Agreements

Check for plugin incompatibilites

There are no other plugins running on my server.

Plugin Version, Server Software, Server Version

Nova-0.15-alpha.7

Nova Addons and Versions

Logistics-0.2.7-RC.2, Machines-0.4.4-RC.1, Simple-Upgrades-1.2-RC.1

Expected behavior

No response

Observed/Actual behavior

Blocks that can be broken instantly will not break if you have a tool in hand. If the block breaks instantly by hand, regardless of the tool in hand, it will not break if you have a tool in hand. If the block only breaks instantly when using a specific tool, it will not break when using that tool or a superior tool tiers.

Steps to reproduce

  1. Place a creativ energy cell
  2. Take diamond axe in main hand
  3. Try to break it in survival gamemode

Server log

https://pastebin.com/VJYRwmhu

Errors

No response

Additional context

No response

NichtStudioCode commented 9 months ago

Update on the state of this issue:

The problem here is that the client predicts the block to be broken instantaneously, but the server doesn't, so Nova cancels the breaking process. Allowing this would be possible, but that would mean that you could instantaneously break mushroom-backed blocks with an axe and loose the drop (if axe is not the correct tool). I also didn't want to apply the (client-side) mining fatigue effect permanently, because it would be visible in the inventory and confusing for players, especially if they actually do have (server-side) mining fatigue.

However, we will be able to fix this when 1.20.5 comes out, because Mojang just added the player.block_break_speed attribute in the latest snapshot, which will replace the usage of the mining fatigue effect and can stay applied permanently.