mirror of
https://github.com/eaglerforge/EaglerForgeInjector
synced 2025-07-23 14:11:16 -09:00
Update npcspawner.js
This commit is contained in:
parent
b683b5d40c
commit
2adc025d3a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user