Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class KillAura extends Mod{
- private int ticks = 0;
- public KillAura() {
- super("KillAura", "KillAura", Keyboard.KEY_R, Category.COMBAT);
- }
- public void onUpdate(){
- if(this.isToggled()){
- ticks++;
- if(ticks >= 20 - speed()){
- ticks = 0;
- for(Iterator<Entity> entities = mc.theWorld.loadedEntityList.iterator(); entities.hasNext();) {
- Object theObject = entities.next();
- if(theObject instanceof EntityLivingBase) {
- EntityLivingBase entity = (EntityLivingBase) theObject;
- if(entity instanceof EntityPlayerSP) continue;
- if(mc.thePlayer.getDistanceToEntity(entity) <= 7F) {
- if(entity.isInvisible()){
- break;
- }
- if(entity.isEntityAlive()) {
- if(mc.thePlayer.getHeldItem() != null){
- mc.thePlayer.setItemInUse(mc.thePlayer.getHeldItem(), mc.thePlayer.getHeldItem().getMaxItemUseDuration());
- }
- if(mc.thePlayer.isBlocking()){
- mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.UP));
- }
- mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(entity, C02PacketUseEntity.Action.ATTACK));
- mc.thePlayer.swingItem();
- break;
- }
- }
- }
- }
- }
- }
- }
- private int speed() {
- return 18;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement