use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.
the class AutoFishHack method onReceivedPacket.
@Override
public void onReceivedPacket(PacketInputEvent event) {
ClientPlayerEntity player = MC.player;
if (player == null || player.fishHook == null)
return;
if (!(event.getPacket() instanceof PlaySoundS2CPacket))
return;
// check sound type
PlaySoundS2CPacket sound = (PlaySoundS2CPacket) event.getPacket();
if (!SoundEvents.ENTITY_FISHING_BOBBER_SPLASH.equals(sound.getSound()))
return;
if (debugDraw.isChecked())
lastSoundPos = new Vec3d(sound.getX(), sound.getY(), sound.getZ());
// check position
FishingBobberEntity bobber = player.fishHook;
if (Math.abs(sound.getX() - bobber.getX()) > validRange.getValue() || Math.abs(sound.getZ() - bobber.getZ()) > validRange.getValue())
return;
// check open water
boolean isOpenWater = isInOpenWater(bobber);
if (!isOpenWater && wasOpenWater) {
ChatUtils.warning("You are currently fishing in shallow water.");
ChatUtils.message("You can't get any treasure items while fishing like this.");
if (!WURST.getHax().openWaterEspHack.isEnabled())
ChatUtils.message("Use OpenWaterESP to find open water.");
}
// catch fish
rightClick();
castRodTimer = 15;
wasOpenWater = isOpenWater;
}
use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.
the class BonemealAuraHack method selectBonemeal.
private void selectBonemeal() {
ClientPlayerEntity player = MC.player;
int maxInvSlot = automationLevel.getSelected().maxInvSlot;
for (int slot = 0; slot < maxInvSlot; slot++) {
if (slot == player.getInventory().selectedSlot)
continue;
ItemStack stack = player.getInventory().getStack(slot);
if (stack.isEmpty() || stack.getItem() != Items.BONE_MEAL)
continue;
if (slot < 9)
player.getInventory().selectedSlot = slot;
else if (player.getInventory().getEmptySlot() < 9)
IMC.getInteractionManager().windowClick_QUICK_MOVE(slot);
else if (player.getInventory().getEmptySlot() != -1) {
IMC.getInteractionManager().windowClick_QUICK_MOVE(player.getInventory().selectedSlot + 36);
IMC.getInteractionManager().windowClick_QUICK_MOVE(slot);
} else {
IMC.getInteractionManager().windowClick_PICKUP(player.getInventory().selectedSlot + 36);
IMC.getInteractionManager().windowClick_PICKUP(slot);
IMC.getInteractionManager().windowClick_PICKUP(player.getInventory().selectedSlot + 36);
}
return;
}
}
use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.
the class TpCmd method call.
@Override
public void call(String[] args) throws CmdException {
BlockPos pos = argsToPos(args);
ClientPlayerEntity player = MC.player;
player.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
}
use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.
the class ViewNbtCmd method call.
@Override
public void call(String[] args) throws CmdException {
ClientPlayerEntity player = MC.player;
ItemStack stack = player.getInventory().getMainHandStack();
if (stack.isEmpty())
throw new CmdError("You must hold an item in your main hand.");
NbtCompound tag = stack.getNbt();
String nbt = tag == null ? "" : tag.asString();
switch(String.join(" ", args).toLowerCase()) {
case "":
ChatUtils.message("NBT: " + nbt);
break;
case "copy":
MC.keyboard.setClipboard(nbt);
ChatUtils.message("NBT data copied to clipboard.");
break;
default:
throw new CmdSyntaxError();
}
}
use of net.minecraft.client.network.ClientPlayerEntity in project Wurst7 by Wurst-Imperium.
the class TriggerBotHack method onUpdate.
@Override
public void onUpdate() {
ClientPlayerEntity player = MC.player;
if (player.getAttackCooldownProgress(0) < 1)
return;
if (MC.crosshairTarget == null || !(MC.crosshairTarget instanceof EntityHitResult))
return;
Entity target = ((EntityHitResult) MC.crosshairTarget).getEntity();
if (!isCorrectEntity(target))
return;
WURST.getHax().autoSwordHack.setSlot();
WURST.getHax().criticalsHack.doCritical();
MC.interactionManager.attackEntity(player, target);
player.swingHand(Hand.MAIN_HAND);
}
Aggregations