PowerNukkitX / PowerNukkitX-Legacy

GNU General Public License v3.0
7 stars 4 forks source link

Request onBreak method with player field for blocks #1

Open theaddonn opened 1 year ago

theaddonn commented 1 year ago

❇ Feature Request | 特性请求

Description

Might it be possible to add a onBreak with a player method to Blocks? We right now just have onBreak(Item item) { ... } but might it be possible to add a method like onBreak(Item item, Player player) { ... }

Already existing examples

The Block method getBreakTime already offers theese 2 options:

  1. getBreakTime (Item item, Player player) { ... }
  2. getBreakTime(Item item) { ... }

Smoll workarounds

I know that you still can get the player with an onBlockBreakevent but, It makes more sense to work it in the already existing onBreak method of a block ~ it also isn't maintainable for plugin devs to add many cases to the onBlockBreak event listener

final String

Have a good day