Jump to content

Woodgolem25

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Woodgolem25's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey thanks for the tip but I've never used a NBT, heard of it though. Would it be OK if I got a skeleton of the method? Thanks if not anyway though. Also to you and shield thanks for informing me on static variables.
  2. Here is the code package com.opitems.mob; import com.opitems.main.ArmorRegistry; import com.opitems.main.ItemRegistry; import com.opitems.main.ToolRegistry; import com.sun.javafx.scene.text.HitInfo; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAIMoveThroughVillage; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.boss.IBossDisplayData; import net.minecraft.entity.monster.EntityMob; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.potion.PotionEffect; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraftforge.common.ForgeModContainer; public class opWarriorBoss extends EntityMob{ public opWarriorBoss(World world) { super(world); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); } public static double damage = 160.0; public void changeDamage(){ if(damage < 300.0D && hitByEntity(getLastAttacker())){ damage++; } } protected void applyEntityAttributes(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(3000.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(damage); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(64.0D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.5D); } protected void dropFewItems(boolean p_70628_1_, int p_70628_2_) { switch(this.rand.nextInt(3)){ case 0: this.dropItem(ToolRegistry.opSword, 1); break; case 1: this.dropItem(ToolRegistry.opSword2, 1); break; case 2: this.dropItem(ToolRegistry.opSword2, 1); } } protected void dropRareDrop(int p_70600_1_) { switch (this.rand.nextInt(3)) { case 0: this.dropItem(Items.nether_star, 5); break; case 1: this.dropItem(ArmorRegistry.opChestplate, 1); break; case 2: this.dropItem(ItemRegistry.opGem, 10); } } protected void addRandomArmor() { super.addRandomArmor(); if (this.rand.nextFloat() < (this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.05F : 0.01F)) { int i = this.rand.nextInt(3); if (i == 0) { this.setCurrentItemOrArmor(0, new ItemStack(ToolRegistry.opSword)); } else { this.setCurrentItemOrArmor(0, new ItemStack(ToolRegistry.opShovel)); } } } }
  3. So I am making an Entity(Monster) and when I try to change his damage automatically it doesn't work to well. I go into my mob file MonsterName.java and above the attributes code protected void applyEntityAttributes(){} I put some automatic damage changer using if statements but when I run it with no errors my entity stops working and doesn,t show up in game. is there another area I am suppose to put it?
×
×
  • Create New...

Important Information

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