From 2adc025d3a725c26445535116648fa668ff84993 Mon Sep 17 00:00:00 2001 From: radmanplays <95340057+radmanplays@users.noreply.github.com> Date: Thu, 19 Sep 2024 23:14:47 +0330 Subject: [PATCH] Update npcspawner.js --- examplemods/npcspawner.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examplemods/npcspawner.js b/examplemods/npcspawner.js index f72b41a..7256c5a 100644 --- a/examplemods/npcspawner.js +++ b/examplemods/npcspawner.js @@ -11,10 +11,14 @@ const GameProfileClass = ModAPI.reflect.getClassById("net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile"); const fakeProfile = GameProfileClass.constructors[1](null, ModAPI.util.str("Steve")); + // Get the PlayerInteractionManager class + const PlayerInteractionManagerClass = ModAPI.reflect.getClassById("net.minecraft.server.management.PlayerInteractionManager"); + const playerInteractionManager = PlayerInteractionManagerClass.constructors[1](world.getRef()); + // Get the EntityPlayerMP class to spawn the fake player const EntityPlayerMPClass = ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP"); const fakePlayer = EntityPlayerMPClass.constructors[1]( - world.getMinecraftServer(), world.getRef(), fakeProfile, world.getPlayerInteractionManager() + world.getMinecraftServer(), world.getRef(), fakeProfile, playerInteractionManager ); // Set the fake player position to be near the command sender