Начинающий
- Статус
- Оффлайн
- Регистрация
- 6 Авг 2024
- Сообщения
- 104
- Реакции
- 0
SS - а смысл просто получение зелья ночного зрения
CODE:
package xd.xclient.functions.impl.render;
import com.google.common.eventbus.Subscribe;
import xd.xclient.events.EventMotion;
import xd.xclient.functions.api.Category;
import xd.xclient.functions.api.Function;
import xd.xclient.functions.api.FunctionRegister;
import net.minecraft.client.Minecraft;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.entity.player.PlayerEntity;
@FunctionRegister(name = "Fullbright", type = Category.Render)
public class Fullbright extends Function {
private final Minecraft mc = Minecraft.getInstance();
public Fullbright() {
applyNightVision();
}
@Subscribe
private void onUpdate(EventMotion e) {
applyNightVision();
}
private void applyNightVision() {
if (mc.player != null) {
PlayerEntity player = mc.player;
if (!player.isPotionActive(Effects.NIGHT_VISION)) {
player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false));
}
}
}
}