#Can I replace vanilla block drops?

1 messages · Page 1 of 1 (latest)

graceful belfry
#

either the type of item or the amount of items dropped?

short orbit
#

Initialize a block break event, getEnties Around block. Use component "minecraft:item" to entities to get ItemStack. Check if item as same as typeId with block.
If u want relace item u shoud remove this item then Dimension.spawnItem() to spawn new item

graceful belfry
#

Thank you!

short orbit
# graceful belfry Thank you!

const dim = block.dimension;
dim.getEntities({type: "minecraft:item", location: block.location,maxDistance: 2}).forEach((itemEntity) => {
const item = itemEntity.getComponent("minecraft:item").itemStack
// do something
})

short orbit