Resource [TUTORIAL] 1.9 Custom NMS Entities, Part 1: Important Entity Methods, and Intro to PathfinderGoals

Discussion in 'Spigot Plugin Development' started by bigans01, May 1, 2016.

  1. Nice tutorial!
  2. Oh haha didn't mean players were getting deleted, my custom entities have been getting deleted or replaced ny default ones
  3. Have you tried with "load: startup" as I suggested before?
    Something like this
    Code (Text):
    name: Test
    main: me.grimerlin.test.Test
    version: 1.0
    author: Grimerlin
    description: Just a test plugin
    load: startup
  4. Haven't tried yet, was just clarifying my previous message, I'll let you know how to goes. Thanks
  5. Hey @teegah,

    Sorry i havent replied lately; i've been very busy on plugin development lately and just now saw this.

    Judging from what i would read on your problem, @Grimerlin's suggestion is what i would try. The Fortress plugin (which manages and spawns all my custom entities) is always loaded on server start. It registers the custom entities with the server, before anyone can join the game.

    If the custom entites aren't registered with the server before a chunk that contains that entity is loaded, it wont recognize that entity when it reads the chunk data, and you will see the message "Skipping entity with ID <custom id>" in the server log. At that point, the entity is deleted and gone forever because the server doesn't know what to do with it.

    Also, an interesting note on when chunks save, that might get around your issue...chunks only "turn on" or "spawn" their entities when players are within a certain range of the chunk, and this range can be smaller than the render distance of said chunk. This means that the chunk that is furthest away from you has been loaded (if your render distance is high like me), but that its entities have not. As long as at least one player is within a certain range of that chunk's entity load distance, the server will load all entities in said chunk. If there are no players within the entity spawn range, all entities are saved to that chunk.

    So, a fast -- but heavy handed approach -- would be to teleport all players away from the chunks you want to save. This will cause the serve to recognize there are no players near those chunks, and will save them and despawn the entities (they will be there when you go back)

    Hope this helps you
    • Like Like x 1
  6. Tping players on a server restart to somewhere just before the server restarts seems kind especially since there will be multiple amounts of these entities. My approach to this would be manually kick all players in onDisable and then have a short timer that does's just there to make sure all chunks are saved since there would be no players online, do you think that's a better solution?
  7. How would I make the entity to walk to multiple locations, I'm using same method that XlordalX used in his tutorial. I tried storing multiple locations in a List<Location> but it seems that my entity walks only to one location and then just stops!
  8. It has to be near by a player, otherwise the pathfinders will not be executed
  9. I spawned a custom entity with a custom name! What I'm trying to do is make that custom entity's name visible to certain player and other players will just see the custom entity's name different. How would I do something like that? Holograms and packets? I'm bad with both :(
  10. Yeah, unfurtunately you have to use holograms and packets. You are not bad, you just need to learn how they works and how to use them. I had problems too with that kind of stuff the first time, so don't worry ;)
  11. Thank you for your help, finally found it! I just save the entity's (ArmorStand) location and every time a player joins it will spawn an entity to the same location that is in the file with different name than other players; I used PacketPlayOutSpawnEntityLiving. Not sure if this is the best idea to do this but at least it works.
  12. That's fine, if you dont want the entity to be server-side and interact with the bukkit api, which is why holograms are not difficult to handle using packets.
  13. Hello everyone,

    I just want to drop in and give some updates (dont worry, its not bad!) on this project, and also thank everyone for keeping this thread active and on point.

    In the recent months since October, i have focused and worked very hard on getting a new job -- which i now have; i had to spend many nights learning new things and didnt get time to dedicate to this project as a result. However, i did restart the Spigot dev server my plugin is hosted on, and everything was working well.

    All that being said, the server does cost me around $60 out of my own pocket to run, so i have to manage it carefully; money is not an issue, as i have enough of it, but i am a practical person.

    However, this is not to say i am not developing. This plugin is very unique in that it is very heavily ingrained with SQL; this is what makes it possible for the custom entities to retain and save their customized features in a reasonable way (and allows the Fortress plugin to use its zone protection features), but at the same time also adds development time as each action is essentially a series of SQL statements. For instance, the Fortress plugin's source currently has around 100 different SQL statements. In addition to this, the source code for the entities is updated every major release, which means even more testing. If you havent guessed already, i have seen many many java crashes in the past months. This is why when i do develop, you may not see much from me frequently.

    I am always looking for people that are interested in helping me dev and test though, so feel free to message me.

    Anyway, expect updates in the near future. I am currently working on the plugin's builtin command line interface and adding useful commands.

    Carry on!


    • Like Like x 2