Jump to content

Recommended Posts

Posted

- 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....

Posted (edited)
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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.