use of net.minecraft.entity.passive.HorseBaseEntity in project BleachHack by BleachDrinker420.
the class CmdEntityStats method onCommand.
@Override
public void onCommand(String alias, String[] args) throws Exception {
if (mc.player.getVehicle() != null) {
if (mc.player.getVehicle() instanceof HorseBaseEntity) {
HorseBaseEntity h = (HorseBaseEntity) mc.player.getVehicle();
BleachLogger.info("Entity Stats:");
BleachLogger.info("\u00a7cMax Health: \u00a7r" + (int) h.getMaxHealth() + " HP");
BleachLogger.info("\u00a7cSpeed: \u00a7r" + getSpeed(h) + " m/s");
BleachLogger.info("\u00a7cJump: \u00a7r" + getJumpHeight(h) + " m");
} else if (mc.player.getVehicle() instanceof LivingEntity) {
LivingEntity l = (LivingEntity) mc.player.getVehicle();
BleachLogger.info("Entity Stats:");
BleachLogger.info("\u00a7cMax Health: \u00a7r" + (int) l.getMaxHealth() + " HP");
BleachLogger.info("\u00a7cSpeed: \u00a7r" + getSpeedLiving(l) + " m/s");
} else {
BleachLogger.error("Current vehicle doesn't have stats.");
}
} else {
BleachLogger.error("Not riding a living entity.");
}
}
use of net.minecraft.entity.passive.HorseBaseEntity in project Client by MatHax.
the class EntityOwner method onRender2D.
@EventHandler
private void onRender2D(Render2DEvent event) {
for (Entity entity : mc.world.getEntities()) {
UUID ownerUuid;
if (entity instanceof TameableEntity)
ownerUuid = ((TameableEntity) entity).getOwnerUuid();
else if (entity instanceof HorseBaseEntity)
ownerUuid = ((HorseBaseEntity) entity).getOwnerUuid();
else if (entity instanceof ProjectileEntity && projectiles.get())
ownerUuid = ((ProjectileEntityAccessor) entity).getOwnerUuid();
else
continue;
if (ownerUuid != null) {
pos.set(entity, event.tickDelta);
pos.add(0, entity.getEyeHeight(entity.getPose()) + 0.75, 0);
if (NametagUtils.to2D(pos, scale.get())) {
renderNametag(getOwnerName(ownerUuid));
}
}
}
}
use of net.minecraft.entity.passive.HorseBaseEntity in project meteor-client by MeteorDevelopment.
the class EntityOwner method onRender2D.
@EventHandler
private void onRender2D(Render2DEvent event) {
for (Entity entity : mc.world.getEntities()) {
UUID ownerUuid;
if (entity instanceof TameableEntity)
ownerUuid = ((TameableEntity) entity).getOwnerUuid();
else if (entity instanceof HorseBaseEntity)
ownerUuid = ((HorseBaseEntity) entity).getOwnerUuid();
else if (entity instanceof ProjectileEntity && projectiles.get())
ownerUuid = ((ProjectileEntityAccessor) entity).getOwnerUuid();
else
continue;
if (ownerUuid != null) {
pos.set(entity, event.tickDelta);
pos.add(0, entity.getEyeHeight(entity.getPose()) + 0.75, 0);
if (NametagUtils.to2D(pos, scale.get())) {
renderNametag(getOwnerName(ownerUuid));
}
}
}
}
use of net.minecraft.entity.passive.HorseBaseEntity in project BleachHack by BleachDrinker420.
the class Nametags method getAnimalLines.
public List<Text> getAnimalLines(LivingEntity animal) {
List<Text> lines = new ArrayList<>();
if (animal instanceof HorseBaseEntity || animal instanceof TameableEntity) {
boolean tame = animal instanceof HorseBaseEntity ? ((HorseBaseEntity) animal).isTame() : ((TameableEntity) animal).isTamed();
UUID ownerUUID = animal instanceof HorseBaseEntity ? ((HorseBaseEntity) animal).getOwnerUuid() : ((TameableEntity) animal).getOwnerUuid();
if (getSetting(2).asToggle().getChild(4).asToggle().getState() && !animal.isBaby() && (getSetting(2).asToggle().getChild(4).asToggle().getChild(0).asMode().getMode() != 1 || tame)) {
lines.add(0, new LiteralText(tame ? "Tamed: Yes" : "Tamed: No").formatted(tame ? Formatting.GREEN : Formatting.RED));
}
if (getSetting(2).asToggle().getChild(5).asToggle().getState() && ownerUUID != null) {
if (uuidCache.containsKey(ownerUUID)) {
lines.add(0, new LiteralText("Owner: " + uuidCache.get(ownerUUID)).formatted(Formatting.GREEN));
} else if (failedUUIDs.contains(ownerUUID)) {
lines.add(0, new LiteralText("Owner: " + Formatting.GRAY + "Invalid UUID!").formatted(Formatting.GREEN));
} else {
// Try to see if the owner is online on the server before calling the mojang api
Optional<GameProfile> owner = mc.player.networkHandler.getPlayerList().stream().map(PlayerListEntry::getProfile).filter(profile -> profile != null && ownerUUID.equals(profile.getId()) && profile.getName() != null).findFirst();
if (owner.isPresent()) {
uuidCache.put(ownerUUID, owner.get().getName());
} else if (!uuidQueue.contains(ownerUUID) && !uuidFutures.containsKey(ownerUUID)) {
uuidQueue.add(ownerUUID);
}
lines.add(0, new LiteralText("Owner: " + Formatting.GRAY + "Loading...").formatted(Formatting.GREEN));
}
}
if (getSetting(2).asToggle().getChild(6).asToggle().getState() && animal instanceof HorseBaseEntity) {
HorseBaseEntity he = (HorseBaseEntity) animal;
lines.add(0, new LiteralText(CmdEntityStats.getSpeed(he) + " m/s" + Formatting.GRAY + " | " + Formatting.RESET + CmdEntityStats.getJumpHeight(he) + " Jump").formatted(Formatting.GREEN));
}
}
List<Text> mainText = new ArrayList<>();
if (getSetting(2).asToggle().getChild(2).asToggle().getState()) {
// Name
mainText.add(((MutableText) animal.getName()).formatted(Formatting.GREEN));
}
if (getSetting(2).asToggle().getChild(3).asToggle().getState()) {
// Health
if (getSetting(0).asMode().getMode() == 2) {
lines.add(0, getHealthText(animal));
} else {
mainText.add(getHealthText(animal));
}
}
if (!mainText.isEmpty())
lines.add(Texts.join(mainText, new LiteralText(" ")));
return lines;
}
use of net.minecraft.entity.passive.HorseBaseEntity in project BleachHack by BleachDrinker420.
the class Freecam method onOpenScreen.
@BleachSubscribe
public void onOpenScreen(EventOpenScreen event) {
if (getSetting(1).asToggle().getState() && riding instanceof HorseBaseEntity) {
if (event.getScreen() instanceof InventoryScreen) {
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.OPEN_INVENTORY));
event.setCancelled(true);
}
}
}
Aggregations