#Modify/change block upon placement
14 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
BlockEvents.placed ('minecraft:stone', event => {
//no need for if
})
You can filter block with this syntax in 1.19 iirc no need for if
and to set block event.level.getblock(pos).set('blockid')
A new error has appeared:
#521: Error occurred while handling event 'BlockEvents.placed': TypeError: Cannot find function getblock in object ServerLevel[New World]
BlockEvents.placed ( 'minecraft:stone', event => {
console.info("GOD SAVE ME")
event.level.getblock(event.block.pos).set('minecraft:dirt')
})
do you have probejs ?
No....
ProbeJS is an addon mod for KubeJS that generates typings files for VSCode, allowing VSCode to offer autocompletions for a ton of things!
Mod by @opal lark
ah it is getBlock() not getblock()
your B is lowercase
sory mb i wrote lowercase in first place 
This works ... very strange...
It definitely does not work like this
BlockEvents.placed ('minecraft:stone', event => {
event.level.getBlock(event.block.x, event.block.y, event.block.z).set('minecraft:dirt', event.block.properties)
})
The stone does not get replaced by dirt.
BUT!
This thing will remove BlockTags from the chest that facing north somehow.
BlockEvents.placed ('minecraft:chest', event => {
event.level.getBlock(event.block.x, event.block.y, event.block.z).set('minecraft:chest')
})
This thing will remove BlockTags from all trapped chests.
BlockEvents.placed ('minecraft:trapped_chest', event => {
event.level.getBlock(event.block.x, event.block.y, event.block.z).set('minecraft:trapped_chest', event.block.properties)
})
At this point, I just lost.
Looks like this script can only change block to itself.
Acceptable for now
Thank you, Sona