#error: cannot read property ‘type’ of undefined

1 messages · Page 1 of 1 (latest)

glossy surge
#
world.beforeEvents.playerPlaceBlock.subscribe((event) => {
    if (event.permutationBeingPlaced.type.id === 'minecraft:soul_campfire') {
        console.log("k")
    }
});
warm fern
glossy surge
warm fern
#

what are you trying to get

warm fern
glossy surge
warm fern
#
if (!block) return
if (block.typeId === 'minecraft:soul_campfire') {
    console.log('k')
}
warm fern
glossy surge
torn rock
#

The block property it will return air/undefined or a block before your placed another block'

#

for example I placed tnt in air, the log will return air/undefined

glossy surge
#

how to fix that?

torn rock