#Block interaction problem

1 messages · Page 1 of 1 (latest)

reef meteor
#

i have this map of variable that have the id of the block and the name of the stat, but when i interact with barrel or bell it doesn't work idk the problem at all since it works on other blocks like furnace, smithing table or chests...

#
const blockMap = {
    'minecraft:cauldron': {
        clean_armor: 'minecraft:clean_armor',
        clean_banner: 'minecraft:clean_banner',
        clean_shulker_box: 'minecraft:clean_shulker_box',
        fill: 'minecraft:fill_cauldron',
        use: 'minecraft:use_cauldron'
    },
    'minecraft:barrel': 'minecraft:open_barrel',
    'minecraft:bell': 'minecraft:bell_ring',
    'minecraft:cake': 'minecraft:eat_cake_slice',
    'minecraft:chest': 'minecraft:open_chest',
    'minecraft:dispenser': 'minecraft:inspect_dispenser',
    'minecraft:dropper': 'minecraft:inspect_dropper',
    'minecraft:ender_chest': 'minecraft:open_enderchest',
    'minecraft:hopper': 'minecraft:inspect_hopper',
    'minecraft:anvil': 'minecraft:interact_with_anvil',
    'minecraft:beacon': 'minecraft:interact_with_beacon',
    'minecraft:blast_furnace': 'minecraft:interact_with_blast_furnace',
    'minecraft:brewing_stand': 'minecraft:interact_with_brewingstand',
    'minecraft:campfire': 'minecraft:interact_with_campfire',
    'minecraft:cartography_table': 'minecraft:interact_with_cartography_table',
    'minecraft:crafting_table': 'minecraft:interact_with_crafting_table',
    'minecraft:furnace': 'minecraft:interact_with_furnace',
    'minecraft:grindstone': 'minecraft:interact_with_grindstone',
    'minecraft:lectern': 'minecraft:interact_with_lectern',
    'minecraft:loom': 'minecraft:interact_with_loom',
    'minecraft:smithing_table': 'minecraft:interact_with_smithing_table',
    'minecraft:smoker': 'minecraft:interact_with_smoker',
    'minecraft:stonecutter': 'minecraft:interact_with_stonecutter',
    'minecraft:flower_pot': 'minecraft:pot_flower',
    'minecraft:target': 'minecraft:target_hit',
    'minecraft:shulker_box': 'minecraft:open_shulker_box',
    'minecraft:noteblock': 'minecraft:tune_noteblock',
    'minecraft:jukebox': 'minecraft:play_record',
    'minecraft:air': 'minecraft:air'
};

world.afterEvents.playerInteractWithBlock.subscribe(({
        block,
        player,
        beforeItemStack,
        itemStack
    }) => {
    const blocks = blockMap[block.typeId];
    const perm = blockPerm.get(player);

    if (blocks) {
        if (perm && perm !== block.permutation) {}
        else if (!['minecraft:cake', 'minecraft:flower_pot', 'minecraft:cauldron', 'minecraft:air', 'minecraft:jukebox'].includes(block.typeId))
            console.error('test')
    }
});```
#

NVM IM FUCKIN STUPID