Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. public class CustomBandi extends EntitySkeleton {
  2.  
  3. public CustomBandi(World world) {
  4. super(world);
  5. this.goalSelector.a(1, new PathfinderGoalFloat(this));
  6. this.goalSelector.a(5, new PathfinderGoalRandomStroll(this, 1.0D));
  7. this.goalSelector.a(6, new PathfinderGoalRandomLookaround(this));
  8. this.targetSelector.a(1, new PathfinderGoalHurtByTarget(this, false));
  9. this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget(this, EntityHuman.class, 0, true));
  10. this.fireProof = true;
  11. a(0.6F, 1.8F);
  12. // Set pathfinding
  13. // Set attributes
  14. // Set equipment
  15. }
  16.  
  17. @Override
  18. protected void aC(){
  19. super.aC();
  20. getAttributeInstance(GenericAttributes.a).setValue(40.0D);
  21. getAttributeInstance(GenericAttributes.b).setValue(30.0D);
  22. getAttributeInstance(GenericAttributes.d).setValue(0.2D);
  23. this.setSkeletonType(0);
  24. this.setCustomName("§cBandit");
  25. this.setCustomNameVisible(true);
  26. }
  27.  
  28. @Override
  29. public void a(EntityLiving ent,float f){
  30. LivingEntity enti = (LivingEntity) ent.getBukkitEntity();
  31. ((Gun)AttackManager.getInstance().findWeaponByName("M4")).onFire(enti, true, false);
  32. }
  33.  
  34. @Override
  35. public GroupDataEntity a(GroupDataEntity groupdataentity) {
  36. this.goalSelector.a();
  37. bC();
  38. return groupdataentity;
  39. }
  40.  
  41. @Override
  42. protected void bC(){
  43. super.bC();
  44. setEquipment(1,CraftItemStack.asNMSCopy(ItemRegistry.getInstance().getItemFromName("LeatherBoots").getItem()));
  45. setEquipment(2,CraftItemStack.asNMSCopy(ItemRegistry.getInstance().getItemFromName("LeatherLeggings").getItem()));
  46. setEquipment(3,CraftItemStack.asNMSCopy(ItemRegistry.getInstance().getItemFromName("LeatherChestplate").getItem()));
  47. setEquipment(4,CraftItemStack.asNMSCopy(ItemRegistry.getInstance().getItemFromName("LeatherHelmet").getItem()));
  48. setEquipment(0,CraftItemStack.asNMSCopy(ItemRegistry.getInstance().getItemFromName("M4").getItem()));
  49. }
  50. protected void dropDeathLoot(boolean flag, int i) {
  51. org.bukkit.World world = this.world.getWorld();
  52. if (Math.random() > 0.9){ world.dropItemNaturally(getBukkitEntity().getLocation(),ItemRegistry.getInstance().getItemFromName("IronAxe").getItem()); return;}
  53. if (Math.random() > 0.9){ world.dropItemNaturally(getBukkitEntity().getLocation(),ItemRegistry.getInstance().getItemFromName("IronPickaxe").getItem()); return;}
  54. if (Math.random() > 0.9){ world.dropItemNaturally(getBukkitEntity().getLocation(),ItemRegistry.getInstance().getItemFromName("StoneAxe").getItem()); return;}
  55. if (Math.random() > 0.5){ world.dropItemNaturally(getBukkitEntity().getLocation(),ItemRegistry.getInstance().getItemFromName("Tuna").getItem()); return;}
  56.  
  57. }
  58. protected void getRareDrop(int i) {
  59.  
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement