fix bug 156

This commit is contained in:
ZXMushroom63 2024-09-26 13:10:45 +08:00
parent 4d69375e35
commit d4a9919cd8

View File

@ -40,7 +40,6 @@
// Get the EntityPlayerMP class to spawn the fake player
killFS = true;
AsyncSink.startDebuggingFS();
const EntityPlayerMPClass = ModAPI.reflect.getClassById("net.minecraft.entity.player.EntityPlayerMP");
var worldNameProp = ModAPI.util.getNearestProperty(ModAPI.server.getRef(), "$worldName");
var worldName = ModAPI.server.getRef()[worldNameProp];
@ -55,7 +54,7 @@
fakePlayer.setPosition(senderPos.getX(), senderPos.getY(), senderPos.getZ());
// Add the fake player to the world
world.addEntityToWorld(fakePlayer.getEntityId(), fakePlayer.getRef());
world.spawnEntityInWorld(fakePlayer.getRef());
// Notify the player that the fake player has been spawned
const ChatComponentTextClass = ModAPI.reflect.getClassById("net.minecraft.util.ChatComponentText");