Registering custom entities?



  • Hey, so I was working with Spigot before today, which was when I decided to start working with NMS. There were not that many tutorials for 1.11, so I was having a hard time doing what I wanted to do. I decided to switch to Glowstone because I remembered that the entire thing is open source, so I could look at the source code. There is just one thing. I cannot register my entity! From what I can tell, I cannot do anything to register my entity, for I cannot get the EntityManager, or do anything with the EntityRegister. And even if I had access to the EntityManager, the functions are package-private…


  • Admin

    Paging doctor @mastercoms
    I’m pretty sure this is possible, I remember that the GS core was supposed to be designed so that you could do things like this.

    Are you sure you can’t get a reference? There has to be a manager stored somewhere. Package-private could be a problem, though.



  • Are you looking for GlowWorld#getEntityManager()? In EntityRegistry, everything is public static for some reason, so you shouldn’t need to get an instance.



  • @Sataniel That is great, and I can get that from GlowServer, but the thing is; required methods, such as EntityManager#register are package private. That means that unless I am in that package (Which I will never be, unless I help make a commit or something) I cannot use those methods.

    And @gdude2002 I am going to make a pull request to make those methods public. Once that happens, I will be able to make the custom entities.

    UPDATE: I have now made the pull request: here.



  • This post is deleted!

Log in to reply
 

Looks like your connection to Glowstone was lost, please wait while we try to reconnect.