detect wandering trader

This commit is contained in:
sebseb7
2023-12-26 04:44:31 +01:00
parent 3b8129427d
commit 140aae7f4a
2 changed files with 8 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ import net.minecraft.client.gui.screen.ingame.MerchantScreen;
import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.entity.passive.WanderingTraderEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.c2s.play.SelectMerchantTradeC2SPacket;
@@ -293,7 +294,7 @@ public class KeybindCallbacks implements IHotkeyCallback, IClientTickHandler {
Vector<Entity> newVillagersInRange = new Vector<Entity>(villagersInRange);
for (Entity entity : mc.player.clientWorld.getEntities()) {
if (entity instanceof VillagerEntity) {
if (entity instanceof VillagerEntity || entity instanceof WanderingTraderEntity) {
if (entity.getPos().distanceTo(mc.player.getPos()) < 2.5f) {
if (found == false) {
if (newVillagersInRange.contains(entity) == false) {