#error: cannot read property ‘type’ of undefined
1 messages · Page 1 of 1 (latest)
why permutationBeingPlaced.type.id
then what it should be
what are you trying to get
why you re getting the permutation?
cause it not working with the “block.typeId”?
you know that the block can be undefined?
if (!block) return
if (block.typeId === 'minecraft:soul_campfire') {
console.log('k')
}
you can get the typeid of the placed blocks only in afterEvents, in before events return the block that was there before placing
I did this and still nothing is happening
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
how to fix that?
world.beforeEvents.playerPlaceBlock.subscribe(({ block, permutationBeingPlaced, player }) => {
console.error('permutationBeingPlaced', permutationBeingPlaced.type.id);
console.error('block', block.typeId)
});```