import { ItemStack, system, world } from '@minecraft/server';

export function attemptToInventory(player, itemStack, location, dimension){
    const inventory = player.getComponent("inventory").container;
    const emptySlots = inventory.emptySlotsCount;
    if (!emptySlots)dimension.spawnItem(itemStack,location);
    else inventory.addItem(itemStack)
}