1.16.5 Issue with NMS Mob and Spawning

Discussion in 'Spigot Plugin Development' started by kingwolf12323423, Jul 3, 2021.

  1. I believe that you cannot create a custom entity this way using spigot. I reccomend using spigots' api for spawning mobs, Bukkit.getWorld().spawnEntity()
  2. In the post i say the entity type is null so thats why i cant spawn it and when i use that this happens error: https://paste.helpch.at/itabixivoy.rb

    method : https://paste.helpch.at/fihizaqaze.cs
  3. Yes, you need a valid entity type, in your code you do not specify this. You should be able to do in the class:
    Code (Text):
    this.type = EntityType.ZOMBIE;
  4. like
    this? https://paste.helpch.at/valusuqaki.java
  5. What is your goal here? Why is NMS being used?
  6. because i want to use path finder goals because i want to make animals fight the player
  7. It is not easy to do and there aren't a lot of people who do pathfinding on spigot who can help you. I suggest that as far as possible, use the spigot API to achieve that, maybe some sort of scheduler along with setTarget. You should only tackle Pathfinders in NMS if you understand the underlying API as well as the NMS required, if not it will be extremely painful to maintain
  8. Then you need make custom path finder
  9. its very easy to do and i have done it before just right now i just need to spawn the mob this is diffrent because its constructor
  10. If it's easy, why are you asking? lol
  11. dude he said its hard with pathfinder golas but its not for me its the mob thats hard
  12. You said its very easy then what does mean?
  13. did you even ready the post thats not the issue its the spawing mob thats hard
  14. Already
  15. read* lmfao
  16. Please read the post before replying and not helping he said why i wanted to use nms and i said becase i want to ake mobs fight using path finder then you came replying saying i need to use path finder then correct my spelling.
  17. I'm referring to the full chain. The entire process.
    Creating the mob -> Registering the mob -> Spawning the mob -> Updating the mob across versions.

    But okay, let's look at the error. It says "double world add". So a general guess would be that you're trying to call addEntity with the same object, which results in a failure.
    See if setting "spawnAmount" to 1 solves the issue.