use of net.minecraft.entity.decoration.EndCrystalEntity in project BleachHack by BleachDrinker420.
the class AutoLog method getLogText.
private Text getLogText() {
boolean hasTotem = mc.player.getMainHandStack().getItem() == Items.TOTEM_OF_UNDYING || mc.player.getOffHandStack().getItem() == Items.TOTEM_OF_UNDYING;
int playerHealth = (int) (mc.player.getHealth() + mc.player.getAbsorptionAmount());
if (getSetting(0).asToggle().getState()) {
int health = getSetting(0).asToggle().getChild(0).asSlider().getValueInt();
if ((getSetting(0).asToggle().getChild(1).asToggle().getState() || !hasTotem) && playerHealth <= health) {
return new LiteralText("[AutoLog] Your health (" + playerHealth + " HP) was lower than " + health + " HP.");
}
if (getSetting(0).asToggle().getChild(2).asToggle().getState() && mc.player.getVehicle() instanceof LivingEntity) {
LivingEntity vehicle = (LivingEntity) mc.player.getVehicle();
int vehicleHealth = (int) (vehicle.getHealth() + vehicle.getAbsorptionAmount());
if (vehicleHealth < health) {
return new LiteralText("[AutoLog] Your vehicle health (" + vehicleHealth + " HP) was lower than " + health + " HP.");
}
}
}
if (getSetting(1).asToggle().getState() && !hasTotem) {
for (PlayerEntity player : mc.world.getPlayers()) {
if ((!getSetting(1).asToggle().getChild(0).asToggle().getState() && BleachHack.friendMang.has(player)) || player == mc.player) {
continue;
}
int attackDamage = (int) DamageUtils.getAttackDamage(player, mc.player);
if (player.distanceTo(mc.player) <= 6 && attackDamage >= playerHealth) {
return new LiteralText("[AutoLog] " + player.getDisplayName().getString() + " could kill you (dealing " + attackDamage + " damage).");
}
}
}
if (getSetting(2).asToggle().getState()) {
for (Entity e : mc.world.getEntities()) {
if (e instanceof EndCrystalEntity && mc.player.distanceTo(e) <= getSetting(2).asToggle().getChild(0).asSlider().getValue()) {
return new LiteralText("[AutoLog] End crystal appeared within range.");
}
}
}
if (getSetting(3).asToggle().getState()) {
double range = getSetting(3).asToggle().getChild(0).asToggle().getState() ? getSetting(3).asToggle().getChild(0).asToggle().getChild(0).asSlider().getValue() : Double.MAX_VALUE;
for (PlayerEntity player : mc.world.getPlayers()) {
if (!EntityUtils.isOtherServerPlayer(player) || (!getSetting(3).asToggle().getChild(1).asToggle().getState() && BleachHack.friendMang.has(player))) {
continue;
}
if (player.distanceTo(mc.player) <= range) {
return new LiteralText("[AutoLog] " + player.getDisplayName().getString() + " appeared " + (int) player.distanceTo(mc.player) + " blocks away.");
}
}
}
return null;
}
use of net.minecraft.entity.decoration.EndCrystalEntity in project tanuki by AntiCope.
the class AntiCrystal method onTick.
@EventHandler
private void onTick(TickEvent.Post event) {
assert mc.world != null;
assert mc.player != null;
Optional<EndCrystalEntity> crystalTarget = Streams.stream(mc.world.getEntities()).filter(e -> (e instanceof EndCrystalEntity)).filter(e -> e.distanceTo(mc.player) <= range.get() * 2).filter(e -> mc.world.getBlockState(e.getBlockPos()).isAir()).min(Comparator.comparingDouble(o -> o.distanceTo(mc.player))).map(e -> (EndCrystalEntity) e);
crystalTarget.ifPresent(crystal -> {
if (mode.get() == Mode.PressurePlate) {
FindItemResult result = InvUtils.find(PLATES);
if (!result.found())
return;
BlockUtils.place(crystal.getBlockPos(), result, rotate.get(), 100);
} else if (mode.get() == Mode.Button) {
FindItemResult result = InvUtils.find(BUTTONS);
if (!result.found())
return;
BlockUtils.place(crystal.getBlockPos(), result, rotate.get(), 100);
}
});
}
use of net.minecraft.entity.decoration.EndCrystalEntity in project meteor-client by MeteorDevelopment.
the class AutoLog method onTick.
@EventHandler
private void onTick(TickEvent.Post event) {
if (mc.player.getHealth() <= 0) {
this.toggle();
return;
}
if (mc.player.getHealth() <= health.get()) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Health was lower than " + health.get() + ".")));
if (smartToggle.get()) {
this.toggle();
enableHealthListener();
}
}
if (smart.get() && mc.player.getHealth() + mc.player.getAbsorptionAmount() - PlayerUtils.possibleHealthReductions() < health.get()) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Health was going to be lower than " + health.get() + ".")));
if (toggleOff.get())
this.toggle();
}
for (Entity entity : mc.world.getEntities()) {
if (entity instanceof PlayerEntity && entity.getUuid() != mc.player.getUuid()) {
if (onlyTrusted.get() && entity != mc.player && !Friends.get().isFriend((PlayerEntity) entity)) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] A non-trusted player appeared in your render distance.")));
if (toggleOff.get())
this.toggle();
break;
}
if (mc.player.distanceTo(entity) < 8 && instantDeath.get() && DamageUtils.getSwordDamage((PlayerEntity) entity, true) > mc.player.getHealth() + mc.player.getAbsorptionAmount()) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] Anti-32k measures.")));
if (toggleOff.get())
this.toggle();
break;
}
}
if (entity instanceof EndCrystalEntity && mc.player.distanceTo(entity) < range.get() && crystalLog.get()) {
mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(new LiteralText("[AutoLog] End Crystal appeared within specified range.")));
if (toggleOff.get())
this.toggle();
}
}
}
use of net.minecraft.entity.decoration.EndCrystalEntity in project Client by MatHax.
the class SelfProtect method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
if (antiAnchorAura.get() && mc.world.getBlockState(mc.player.getBlockPos().up(2)).getBlock() == Blocks.RESPAWN_ANCHOR && mc.world.getBlockState(mc.player.getBlockPos().up()).getBlock() == Blocks.AIR)
BlockUtils.place(mc.player.getBlockPos().add(0, 1, 0), InvUtils.findInHotbar(itemStack -> Block.getBlockFromItem(itemStack.getItem()) instanceof SlabBlock), rotate.get(), 15, swing.get(), false, true);
BlockPos top = mc.player.getBlockPos().up(2);
if (antiCEVBreaker.get() && mc.world.getBlockState(top).getBlock() == Blocks.OBSIDIAN) {
Iterator<Entity> iterator = mc.world.getEntities().iterator();
coder: while (true) {
while (true) {
if (!iterator.hasNext())
break coder;
Entity crystal = iterator.next();
if (crystal instanceof EndCrystalEntity && crystal.getBlockPos().equals(top.up())) {
mc.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.attack(crystal, mc.player.isSneaking()));
ceved = true;
} else if (ceved) {
BlockUtils.place(top.up(), InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 50, true);
ceved = false;
}
}
}
}
if (antiTNTAura.get()) {
if (mc.world.getBlockState(top).getBlock().equals(Blocks.TNT)) {
if (rotate.get())
Rotations.rotate(Rotations.getYaw(top), Rotations.getPitch(top), () -> mine(top));
else
mine(top);
tntAured = true;
} else if (tntAured) {
if (placeObsidian.get())
BlockUtils.place(top, InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 50, true);
tntAured = false;
}
}
if (antiBedAura.get()) {
if (onlyInHole.get() && !PlayerUtils.isInHole2(true))
return;
BlockPos head = mc.player.getBlockPos().up();
if (mc.world.getBlockState(head).getBlock() instanceof BedBlock && !breaking) {
Rotations.rotate(Rotations.getYaw(head), Rotations.getPitch(head), 50, () -> sendMinePackets(head));
breaking = true;
} else if (breaking) {
Rotations.rotate(Rotations.getYaw(head), Rotations.getPitch(head), 50, () -> sendStopPackets(head));
breaking = false;
}
if (smart.get()) {
if (mc.world.getBlockState(head).getBlock() instanceof BedBlock)
bedAured = true;
else if (bedAured) {
if (placeStringTop.get())
place(mc.player.getBlockPos().up(2));
if (placeStringMiddle.get())
place(mc.player.getBlockPos().up(1));
if (placeStringBottom.get())
place(mc.player.getBlockPos());
tntAured = false;
}
} else if (!smart.get()) {
if (placeStringTop.get())
place(mc.player.getBlockPos().up(2));
if (placeStringMiddle.get())
place(mc.player.getBlockPos().up(1));
if (placeStringBottom.get())
place(mc.player.getBlockPos());
}
}
}
use of net.minecraft.entity.decoration.EndCrystalEntity in project orion by AntiCope.
the class SurroundPlus method onTick.
@EventHandler
private void onTick(TickEvent.Pre event) {
int bpt = 0;
if ((disableJump.get() && (mc.options.jumpKey.isPressed() || mc.player.input.jumping)) || (disableYchange.get() && mc.player.prevY < mc.player.getY())) {
toggle();
return;
}
if (groundOnly.get() && !mc.player.isOnGround())
return;
if (sneakOnly.get() && !mc.options.sneakKey.isPressed())
return;
if (BlockHelper.isVecComplete(getSurrDesign())) {
if (disableAfter.get()) {
info("Surround Complete.");
toggle();
}
} else {
BlockPos ppos = mc.player.getBlockPos();
for (Vec3d b : getSurrDesign()) {
if (bpt >= blockPerTick.get())
return;
BlockPos bb = ppos.add(b.x, b.y, b.z);
if (BlockHelper.getBlock(bb) == Blocks.AIR) {
if (placeInside.get()) {
BlockUtils.place(bb, InvUtils.findInHotbar(itemStack -> blocks.get().contains(Block.getBlockFromItem(itemStack.getItem()))), rotation.get(), 100, false);
} else {
BlockUtils.place(bb, InvUtils.findInHotbar(itemStack -> blocks.get().contains(Block.getBlockFromItem(itemStack.getItem()))), rotation.get(), 100, true);
}
bpt++;
}
}
}
if (protect.get()) {
for (Entity entity : mc.world.getEntities()) {
if (entity instanceof EndCrystalEntity) {
BlockPos crystalPos = entity.getBlockPos();
if (isDangerousCrystal(crystalPos)) {
mc.player.networkHandler.sendPacket(PlayerInteractEntityC2SPacket.attack(entity, mc.player.isSneaking()));
mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
return;
}
}
}
}
}
Aggregations