How to obtain the drops of a block

Is there any way to get a List<ItemStack> from a BlockState/BlockSnapshot ?

What I did was listened to the DropItemEvent.Destruct event and add the filter @All BlockSnapshot[] snapshots, like so

@Listener
public void onDropItemEventDestruct(DropItemEvent.Destruct event, @All BlockSnapshot[] snapshots){
    do stuff
}

Thank, but I don’t want to break a block or listen to this, I just want to obtain the block’s drops when I need them ^^

@Yeregorix This will be added to the API fairly soon.

2 Likes

Did this ever get added? If so how? Cannot find a obvious method to find this within BlockState.