#raising the boiling point
9 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
iirc the water evaporating logic locates in bucket items, so you should be able to add the water block back with block.set in BlockEvents.rightClicked.
You just need to check if the dimention is ultraWarm()
https://lexxie.dev/forge/1.19.2/net/minecraft/world/level/dimension/DimensionType.html#ultraWarm()
And check if the block clicked is LiquidBlockContainer (able to be water logged)
https://lexxie.dev/forge/1.19.2/net/minecraft/world/level/block/LiquidBlockContainer.html
And if that's false check if the block at the direction you click is air
Place water when suitable, and if all that are false, replace the empty bucket in hand with a full water bucket.
declaration: package: net.minecraft.world.level.block, interface: LiquidBlockContainer
declaration: package: net.minecraft.world.level.dimension, record: DimensionType
please forgive me, but, Idk wth I'm looking at with this I'm not gonna lie
well, I can write some example code later
Your the best bro
BlockEvents.rightClicked(event => {
const {item, level, block, facing, player, hand} = event
if(item.id != "minecraft:water_bucket") return;
if(!level.dimensionType().ultraWarm()) return;
const waterloggedPropertyOptional = block.blockState.properties.stream().filter(property => property.getName() == "waterlogged").findFirst()
if(waterloggedPropertyOptional.present){
const [propertyTrue, propertyFalse] = [true, false].map(boolean => waterloggedPropertyOptional.get().getValue(`${boolean}`).get())
if(block.blockState.getValue(waterloggedPropertyOptional.get() == false)){
block.blockState.setValue(propertyTrue)
return;
}
}
const /**@type {Internal.BlockContainerJS} */ targetedBlock = block[facing]
if(targetedBlock.blockState.isAir()) {
targetedBlock.set("minecraft:water")
return;
}
player.setItemInHand(hand, "minecraft:water_bucket")
})