Method addEntityMethod = worldServerObject.getClass().getMethod("addEntity", entit圜lass, ()) ĪddEntityMethod.invoke(entityObject, SpawnReason. Object entityObject = entit圜lass.cast(entityTypeObject) Contactless delivery and your first delivery is free Start shopping with Instacart now to get products, on-demand. Object entityTypeObject = entityGetHandleMethod.invoke(craftEntityObject) Ĭlass entit圜lass = getNMSClass(".", "Entity") Get Meijer Large Green Reflective Leash delivered to you within two hours via Instacart. Method entityGetHandleMethod = craftEntit圜lass.getMethod("getHandle") Object craftEntityObject = craftEntit圜lass.cast(entity) Object worldServerObject = getHandleMethod.invoke(craftWorldObject) Ĭlass craftEntit圜lass = getNMSClass(".", "entity.CraftEntity") Attempt to invoke the method that creates the entity itself. Method getHandleMethod = craftWorldObject.getClass().getMethod("getHandle") Create variable with the method that get handle Object craftWorldObject = craftWorldClass.cast(entity.getWorld()) To install Reflector Student on your Windows PC or Mac computer, you will need to download and install the WINDOWS PC APP for free.
#How to get reflector 2 for free how to
Cast the bukkit world to the craftworld How to download and install Reflector Student on your PC and Mac. We get the craftworld class with nms so it can be used in multiple versionsĬlass craftWorldClass = getNMSClass(".", "CraftWorld") Nms.addEntity((1_13_R2.Entity) ((CraftEntity) entity).getHandle(), SpawnReason.CUSTOM) This is what I have without Reflector: WorldServer nms = ((CraftWorld) entity.getWorld()).getHandle() but when I use Class.cast(Object o) I get unwanted classes. In short, in any case, I want my plugin to be a maximum multi-version, so I use Reflector. I am currently developing a Minecraft plugin that should be able to manage mobs.