import { Block, Dimension, Player } from "@minecraft/server";
import { setBlockToAir } from "../../library/blockManager";

/**
 * Evento del componente dropBoxComponent
 * @param {{player: Player, block: Block, dimension: Dimension}} event 
 */
export const dropBoxEvent = ({player, block, dimension }) => {
    if(!block) return;
    
    dimension.runCommand(`loot spawn ${block.x} ${block.y} ${block.z} loot "blocks/drop_box"`)
    setBlockToAir(block, dimension);
}