#Illusion Maybe 2824 can u teach me this
1 messages · Page 1 of 1 (latest)
Looking at the image
what's the only thing that changes?
Do you notice any patterns?
i didnt change antythin
yes but
i was outside and i wonder
moistrue age ?
ah yes
And now notice
how they relate
if it's 4 or 5, you just add 2 to the number
So we can just
if (e.getHand() == EquipmentSlot.HAND && meta.getCustomModelData() == 2 && block.getType() == Material.FARMLAND) {
switch (farmland.getMoisture()) {
case 0, 4 -> {
world.playSound(block.getLocation(), Sound.ENTITY_BOAT_PADDLE_WATER, SoundCategory.BLOCKS, 5, 2);
world.spawnParticle(Particle.FALLING_WATER, block.getLocation().add(new Vector(0.5, 1, 0.5)), 5, 0.1, 0.1, 0.1);
e.getPlayer().swingMainHand();
farmland.setMoisture(5);
meta.setCustomModelData(1);
block.setBlockData(farmland);
item.setItemMeta(meta);
}
case 6 -> {
world.playSound(block.getLocation(), Sound.ENTITY_BOAT_PADDLE_WATER, SoundCategory.BLOCKS, 5, 2);
world.spawnParticle(Particle.FALLING_WATER, block.getLocation().add(new Vector(0.5, 1, 0.5)), 5, 0.1, 0.1, 0.1);
e.getPlayer().swingMainHand();
farmland.setMoisture(7);
meta.setCustomModelData(1);
block.setBlockData(farmland);
item.setItemMeta(meta);
}
}
}```
if(moisture != 4 && moisture != 5) {
return; // early return
}
// do the rest
setMoisture(moisture + 2);