
IPECTER
Members-
Posts
56 -
Joined
-
Last visited
Everything posted by IPECTER
-
How to add potion effect to mob?(to LivingEntity or Mob or Entity)
IPECTER replied to IPECTER's topic in Modder Support
mob.addEffect(MobEffects.HEALTH_BOOST, ?????????????) I want to add 10 heart for life (infinite) -
How to add potion effect to mob?(to LivingEntity or Mob or Entity)
IPECTER replied to IPECTER's topic in Modder Support
mob.addEffect(MobEffectInstance????????) IDK How to use MobEffectInstance.... -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
AddPermanentModifier does not exist in Mob. -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
before player rejoin the world, 1980/2000 (hp/max hp) after player rejoin the world, 20/2000 -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
@Mod.EventBusSubscriber(modid = "x100health", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class EntityJoinWorld { private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); if (!mob.getPersistentData().contains("x100health")){ mob.getPersistentData().putBoolean("x100health", true); mob.setHealth(mob.getHealth() * 100); } } } } When the player joins the world, the mob's current hp is initialized. -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
@Mod.EventBusSubscriber(modid = "x100health", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class EntityJoinWorld { private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); if (!mob.getPersistentData().contains("x100health")){ mob.getPersistentData().putBoolean("x100health", true); mob.setHealth(mob.getHealth() * 100); } } } } like this! right? -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
mob.getPersistentData().put("x100health", true); Required type: Tag Provided: boolean ...... -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
@Mod.EventBusSubscriber(modid = "x100health", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class EntityJoinWorld { private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); if (!mob.getPersistentData().getBoolean("x100health")){ mob.getPersistentData().put("x100health", tag..?); mob.setHealth(mob.getHealth() * 100); } } } } mob.getPersistentData().put("x100health", tag..?); tag..???? What I should do? -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); } } like this? When mobs spawn for the first time, Mobs have to have full hp. -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
success. thx. but.... private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); if (mob.getHealth() > mob.getAttribute(Attributes.MAX_HEALTH).getBaseValue()) { mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); mob.setHealth(mob.getHealth() * 100); } } } private static final AttributeModifier x100MaxHealth = new AttributeModifier("x100 Max Health", 99, AttributeModifier.Operation.MULTIPLY_BASE); @SubscribeEvent public static void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); if (mob.getHealth() >= mob.getAttribute(Attributes.MAX_HEALTH).getBaseValue()) { mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier(x100MaxHealth); mob.setHealth(mob.getHealth() * 100); } } } Every time a player join the world, even if the mob's hp is lower than the maximum hp, all hp is recovered. What should I do? -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
sorry..... I only succeeded in raising the mob's hp above 1024. Now I have to find a way to control Mob's physical strength using AttributeModifier. -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
private static final AttributeModifier x100MaxHealth = new AttributeModifier(Attributes.MAX_HEALTH, "x100 Max Health", 100, AttributeModifier.Operation.MULTIPLY_BASE); error... Cannot resolve constructor 'AttributeModifier(net.minecraft.world.entity.ai.attributes.Attribute, java.lang.String, int, net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation) -
It's been solved. Thank you so much for helping me.
-
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
public X100health() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup); MinecraftForge.EVENT_BUS.register(EntityJoinWorld.class); } protected static void replaceAttributeValue(RangedAttribute attribute, double maxValue) { attribute.maxValue = maxValue; } private void commonSetup(FMLCommonSetupEvent e) { e.enqueueWork(() -> { replaceAttributeValue((RangedAttribute) Attributes.MAX_HEALTH, 131072); }); } success!!!! thx everyone for help -
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
new AttributeModifier(Attributes.MAX_HEALTH, "x100 Max Health", 100, AttributeModifier.Operation.MULTIPLY_BASE); error... Cannot resolve constructor 'AttributeModifier(net.minecraft.world.entity.ai.attributes.Attribute, java.lang.String, int, net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation)' -
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
..so, I cant use MAX_HEALTH AND HEALTH? hmm..... -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
EntityJoinWorldEvent occurs every time a player visits the world. So, In order not to continue to increase the mob's max health, if the mob's max health is more than 100 times the mob's original max health, it will not change the mob's max health. -
yes! but.. didnt work.. Do you want me to connect this project with GitHub?
-
- 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....
-
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
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).addTransientModifier(x100MaxHealth); mob.setHealth(mob.getHealth() * 100); } } hmm... too hard.. LivingEntity.MAX_HEALTH doesn't exist. I don't know what t put in. Is there any other way to make the maximum max health/healath of all mobs 100 times other than this Event method? -
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
okay Ill try it thx -
How can I get the original Max Health of the entity type (mob)?
IPECTER replied to IPECTER's topic in Modder Support
just... The original of the mob. For Example... cow's original max health is 10. -
How to increase Mob Health and Max Health over 1024?
IPECTER replied to IPECTER's topic in Modder Support
okay.. addTransientModifier() ? ...... @SubscribeEvent public void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); mob.getAttribute(Attributes.MAX_HEALTH).addTransientModifier("What should I put in here?"); mob.setHealth(mob.getHealth() * 100); } } What should I put in here?What should I put in here?What should I put in here?What should I put in here?What should I put in here? -
How can I get the original Max Health of the entity type (mob)? For example, like this. @SubscribeEvent public void onMobSpawn(EntityJoinWorldEvent e) { if (e.getEntity() instanceof Mob) { Mob mob = (Mob) e.getEntity(); if (mob.getOriginalMaxHealth() == mob.getMaxHealth()){ //do something (modify mob max health) } } } " mob.getOriginalMaxHealth() "