Guest User

Untitled

a guest
Feb 16th, 2015
167
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ru.onlymc.OnlyMZ;
  2.  
  3. //import java.lang.reflect.Field;
  4.  
  5. //import org.bukkit.craftbukkit.v1_7_R4.util.UnsafeList;
  6.  
  7. //import net.minecraft.entity.player.EntityPlayer;//import net.minecraft.server.v1_7_R4.EntityHuman;
  8. import net.minecraft.entity.monster.EntityZombie;//import net.minecraft.server.v1_7_R4.EntityZombie;
  9. import net.minecraft.entity.EntityLiving;
  10. import net.minecraft.entity.EntityLivingBase;
  11. import net.minecraft.entity.SharedMonsterAttributes;//import net.minecraft.server.v1_7_R4.GenericAttributes;
  12. //import net.minecraft.entity.ai.EntityAISwimming;//import net.minecraft.server.v1_7_R4.PathfinderGoalFloat;
  13. //import net.minecraft.entity.ai.EntityAIHurtByTarget;//import net.minecraft.server.v1_7_R4.PathfinderGoalHurtByTarget;
  14. //import net.minecraft.entity.ai.EntityAIWatchClosest;//import net.minecraft.server.v1_7_R4.PathfinderGoalLookAtPlayer;
  15. //import net.minecraft.entity.ai.EntityAIAttackOnCollide;//import net.minecraft.server.v1_7_R4.PathfinderGoalMeleeAttack;
  16. //import net.minecraft.entity.ai.EntityAIMoveThroughVillage;//import net.minecraft.server.v1_7_R4.PathfinderGoalMoveThroughVillage;
  17. //import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;//import net.minecraft.server.v1_7_R4.PathfinderGoalMoveTowardsRestriction;
  18. //import net.minecraft.entity.ai.EntityAINearestAttackableTarget;//import net.minecraft.server.v1_7_R4.PathfinderGoalNearestAttackableTarget;
  19. //import net.minecraft.entity.ai.EntityAILookIdle;//import net.minecraft.server.v1_7_R4.PathfinderGoalRandomLookaround;
  20. //import net.minecraft.entity.ai.EntityAIWander;//import net.minecraft.server.v1_7_R4.PathfinderGoalRandomStroll;
  21. //import net.minecraft.entity.ai.EntityAITasks;//import net.minecraft.server.v1_7_R4.PathfinderGoalSelector;
  22. import net.minecraft.world.World;//import net.minecraft.server.v1_7_R4.World;
  23.  
  24. public class CustomEntityZombie extends EntityZombie {
  25.     public CustomEntityZombie(World world) {
  26.         super(world);
  27.  
  28.         ((EntityLiving)this).getNavigator().setBreakDoors(false);
  29.         ((EntityLiving)this).getNavigator().setAvoidSun(false);
  30.         ((EntityLiving)this).getNavigator().setCanSwim(true);
  31.         /*try {
  32.             Field bField = EntityAITasks.class.getDeclaredField("b");
  33.             bField.setAccessible(true);
  34.             Field cField = EntityAITasks.class.getDeclaredField("c");
  35.             cField.setAccessible(true);
  36.             bField.set(((EntityLiving)this).tasks, new UnsafeList<EntityAITasks>());//goalSelector - tasks
  37.             bField.set(((EntityLiving)this).targetTasks, new UnsafeList<EntityAITasks>());//targetSelector - targetTasks
  38.             cField.set(((EntityLiving)this).tasks, new UnsafeList<EntityAITasks>());//goalSelector - tasks
  39.             cField.set(((EntityLiving)this).targetTasks, new UnsafeList<EntityAITasks>());//targetSelector - targetTasks
  40.             } catch (Exception exc) {
  41.             exc.printStackTrace();
  42.         }*/
  43.  
  44.         //a - addTask
  45.         /*((EntityLiving)this).tasks.addTask(0, new EntityAISwimming(this));
  46.         ((EntityLiving)this).tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
  47.         //((EntityLiving)this).tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));
  48.         ((EntityLiving)this).tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
  49.         ((EntityLiving)this).tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
  50.         ((EntityLiving)this).tasks.addTask(7, new EntityAIWander(this, 1.0D));
  51.         ((EntityLiving)this).tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  52.         ((EntityLiving)this).tasks.addTask(8, new EntityAILookIdle(this));
  53.         ((EntityLiving)this).tasks.addTask(1, new EntityAIHurtByTarget(this, true));
  54.         ((EntityLiving)this).tasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
  55.         //((EntityLiving)this).tasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false));*/
  56.     }
  57.  
  58.     protected void aD() {
  59.         super.applyEntityAttributes();
  60.         ((EntityLivingBase)this).getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D);
  61.         ((EntityLivingBase)this).getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.39D);// d - movementSpeed, 0.2300000041723251D
  62.         ((EntityLivingBase)this).getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
  63.     }
  64. }
RAW Paste Data