world.isRainingAt(player.getPosition())
для проверки на дождь и ударяй игрока.public boolean isRainingAt(BlockPos position)
{
if (!this.isRaining())
{
return false;
}
else if (!this.canSeeSky(position))
{
return false;
}
else if (this.getPrecipitationHeight(position).getY() > position.getY())
{
return false;
}
else
{
Biome biome = this.getBiome(position);
if (biome.getEnableSnow())
{
return false;
}
else
{
return this.canSnowAt(position, false) ? false : biome.canRain();
}
}
}