#what event game fires when attempting to place a snow layer?

11 messages · Page 1 of 1 (latest)

waxen geyser
#

title

cyan rampartBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

waxen geyser
#

up

feral vapor
#

doesnt look like there is one, you might have to go with the observer/listener approach where you detect changes in blockstate, what is it you're trying to do exactly might i ask?

waxen geyser
#

if snow layer placed by weather and amount of layers is 8 replace this block with other block

feral vapor
#

yeah something like that, what you could do is hook into the randomTick method of snow layer block and detect when its property reaches 8

waxen geyser
#
BlockEvents.modification(e => {
    e.modify("snow", handler => {
        handler.randomTick(tick => {
            console.log(tick.block.pos)
        })
    })
})
#

[18:59:32] [ERROR] ! example.js#33: Error in 'BlockEvents.modification': Can't find method net.minecraft.world.level.block.SnowLayerBlock.m_213898_(function). [18:59:32] [ERROR] ! …rhino.EvaluatorException: Can't find method net.minecraft.world.level.block.SnowLayerBlock.m_213898_(function). (startup_scripts:example.js#33) [18:59:32] [ERROR] ! at …rhino.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:67) [18:59:32] [ERROR] ! at …rhino.Context.reportRuntimeError(Context.java:133) [18:59:32] [ERROR] ! at …rhino.Context.reportRuntimeError(Context.java:173) [18:59:32] [ERROR] ! at …rhino.Context.reportRuntimeError1(Context.java:145)

feral vapor
#

hmm, did they remove randomTick from the block modification? hmmm