Posted February 17, 20223 yr - src/main/resources/META-INF/accesstransformer.cfg public-f net.minecraft.world.entity.ai.attributes.RangedAttribute f_22308_ # maxValue - in build.gradle... minecraft { accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') } - Main Class @Mod("x100health") @Mod.EventBusSubscriber public class X100health { public X100health() { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void on(FMLCommonSetupEvent e) { e.enqueueWork(() -> { replaceAttributeValue((RangedAttribute) Attributes.MAX_HEALTH, 131072); }); } protected static void replaceAttributeValue(RangedAttribute attribute, double maxValue) { attribute.maxValue = maxValue; } //private static final AttributeModifier x100MaxHealth = new AttributeModifier(LivingEntity.MAX_HEALTH, "x100 Max Health", 100, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).setBaseValue(mob.getAttribute(Attributes.MAX_HEALTH).getBaseValue() * 100); //mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); mob.setHealth(mob.getHealth() * 100); } } } but... mob didnt get max health over 1024.... AT didnt work....
February 17, 20223 yr Author 1 hour ago, Luis_ST said: did you refresh the gradle dependencies? yes! but.. didnt work.. Do you want me to connect this project with GitHub? Edited February 17, 20223 yr by IPECTER
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.