#Prevent farmland from dehydrating

24 messages · Page 1 of 1 (latest)

wild sage
#

I wan farmland with moisture to retain that moisture, and not become dirt or untilled.
basically i want wet farmland to stay wet.

blissful egretBOT
#

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

wild sage
#

so far it seems the best solution for me is to disable random game tick...

knotty linden
#

i made this just to realize that it doesn't work for randomTicks only when the player steps

ForgeEvents.onEvent( 'net.minecraftforge.event.level.BlockEvent$FarmlandTrampleEvent', e => {
    global.trampleEvent(e)
})

/**
 * 
 * @param {Internal.BlockEvent$FarmlandTrampleEvent} e 
 */
global.trampleEvent = e => {
    const { level, pos } = e
    if(level.isClientSide()) return
    console.log('Yo')
    Utils.server.getLevel(Client.level.dimension).getBlock(pos).set('farmland', {moisture:'7'} )
    e.cancelable(true)
}```
#

idk if is possible to detect randomTicks

wild sage
#

Yeah idk, from what i can tell detecting random ticks isn't a thing, and forge doesn't seem to have any block events specific to farmland moisture or reversion :(

wild sage
#

well, not the same but its the same event

knotty linden
wild sage
#

nice lol

knotty linden
#

i think it's possible to create new events in KubeJS but idk how it works, how it hooks to thing or how java works

hidden python
#

Ex: ```js
BlockEvents.modification((e) => {
e.modify('minecraft:budding_amethyst', (block) => {
block.setIsRandomlyTicking(false)
})
})

I don't know if disabling the random ticking of farmland would work tho
wild sage
#

do you know how i could get a list of all blocks in a specific tag at startup?

#

How could i pass in a long list of blocks? can the first argument of modify be an array of block ids?

hidden python
#

No, but just loop through the blocks you need.

wild sage
#

right, thanks!

knotty linden
#

you just need something to make the farmland wet, but just need use the block.set() like i did and you're good to go

wild sage
#

yeah that's the plan

#

okay thanks again!