Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi whenever i hit my boss i can hit him once but no more and he continuously turns red like when you hit a normal mob but stays that way

 

Entity

package com.camerpon900.realauto2.bosses;

import com.camerpon900.realauto2.RealAuto2;
import com.camerpon900.realauto2.entity.EntityCamerpon900Mob;
import cpw.mods.fml.common.registry.EntityRegistry;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;

public class EntityRedstoneBoss extends RA2Boss {

    public EntityRedstoneBoss(World world) {
        super(world);
        this.setSize(3F,4F);
    }

    @Override
    protected void applyEntityAttributes(){
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(220D);
    }

    @Override
    protected void initAI(){
        this.getNavigator().setBreakDoors(true);
        this.tasks.addTask(0, new EntityAIWander(this, 1D));
        this.tasks.addTask(1, new EntityAISwimming(this));
        this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, true));
        this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
    }

    public int hitCount = 0;

    @Override
    public boolean attackEntityFrom(DamageSource par1DamageSource, float par2){
        hitCount++;
        return super.attackEntityFrom(par1DamageSource, par2);
    }

}

 

Bosses Class

package com.camerpon900.realauto2.bosses;

import com.camerpon900.realauto2.RealAuto2;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

public class RA2Boss extends EntityMob implements IRA2Boss {

    public boolean playerCanSee = false;

    public RA2Boss(World world) {
        super(world);
        this.stepHeight = 1.02f;
        initAI();
    }

    @Override
    public void onUpdate() {

    }

    public void addAI() {

    }

    @Override
    protected boolean isAIEnabled(){
        return true;
    }

    @Override
    protected void applyEntityAttributes(){
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(48);
    }

    protected void initAI(){
        this.getNavigator().setBreakDoors(true);
        this.tasks.addTask(0, new EntityAISwimming(this));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
    }

    @Override
    public boolean allowLeashing(){
        return false;
    }

    @Override
    public void addPotionEffect(PotionEffect effect){
        super.addPotionEffect(effect);
    }

    public World func_82194_d(){
        return this.worldObj;
    }

}

 

Renderer

package com.camerpon900.realauto2.bosses.render;

import com.camerpon900.realauto2.bosses.RA2Boss;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.util.ResourceLocation;

public abstract class RenderBoss extends RenderLiving {

    public RenderBoss(ModelBase model) {
        super(model,0.5F);
    }

    @Override
    protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7){
        RA2Boss boss = (RA2Boss)par1EntityLivingBase;
        BossStatus.setBossStatus((RA2Boss) par1EntityLivingBase, true);
        super.renderModel(par1EntityLivingBase, par2, par3, par4, par5, par6, par7);
    }

    @Override
    protected abstract ResourceLocation getEntityTexture(Entity entity);

}

 

EDIT: I am aware that my boss has no AI yet and i want to find this out first before he goes around killing me and i cant do any damage to him

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.