[LIB] [1.7] Remote entities - Next generation NPC library [No support]

Discussion in 'Resources' started by kumpelblase2, Nov 10, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    soulofw0lf

    @IDragonfire thank man, greatly appreciate your effort!
     
  2. Offline

    xNaXDy

    Code:java
    1. RemoteEntity pl = eManager.createNamedEntity(RemoteEntityType.Human, loc, "Test", false);
    2. pl.getMind().addMovementDesire(new DesireLookAtNearest(Player.class, 3F), 1);

    The entity just stands still and when spawning it I'm getting:
    Code:
    10:14:57 [SEVERE] Reached end of stream for null
    Any suggestions?
     
  3. Offline

    IDragonfire

  4. Offline

    phips99

    Can I set the target of an Entity with this API? Like set a Skeleton's shooting target
     
  5. Offline

    Vivaax

    Hey,

    I want to create a sheep, which simply follows me, but it isn't working using this code:

    Code:java
    1. EntityManager em = RemoteEntities.createManager(this);
    2.  
    3. RemoteEntity re = em.createEntity(RemoteEntityType.Ocelot, p.getLocation());
    4. Mind m = re.getMind();
    5.  
    6. re.setStationary(false);
    7.  
    8. m.addMovementDesire(new DesireFollowSpecific(p, 5, 10), m.getHighestMovementPriority() + 1);
    9. m.addBehaviour(new InteractBehavior(re) {
    10.  
    11. @Override
    12. public void onInteract(Player inPlayer) {
    13. p.sendMessage("Hey, what's up? :)");
    14.  
    15. }
    16. });


    The behaviour works, but it is not following me, it is just stationary.. But if I'm to far away, it teleports to me.
    Using an ocelot I get this error while spawning it.

    Code:
    java.lang.NullPointerException
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.api.thinking.goals.DesireNonTamedFindNearest.<init>(DesireNonTamedFindNearest.java:29)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.entities.RemoteOceloteEntity.getDefaultTargetingDesires(RemoteOceloteEntity.java:160)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.entities.RemoteOceloteEntity.setupStandardGoals(RemoteOceloteEntity.java:65)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.ChunkEntityLoader.spawn(ChunkEntityLoader.java:134)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.ChunkEntityLoader.queueSpawn(ChunkEntityLoader.java:122)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:138)
    2013-08-17 11:31:18 [SEVERE]    at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:114)
    And this error with a sheep:
    Code:
    2013-08-17 11:34:18 [SEVERE] java.lang.NullPointerException
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.api.thinking.goals.DesireSwim.<init>(DesireSwim.java:25)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.entities.RemoteSheepEntity.getDefaultMovementDesires(RemoteSheepEntity.java:121)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.entities.RemoteSheepEntity.setupStandardGoals(RemoteSheepEntity.java:51)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.ChunkEntityLoader.spawn(ChunkEntityLoader.java:134)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.ChunkEntityLoader.queueSpawn(ChunkEntityLoader.java:122)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:138)
    2013-08-17 11:34:18 [SEVERE]    at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:114)
    Hope that someone can help me :)
     
    TheGreenGamerHD likes this.
  6. Offline

    Raemis


    This is what I'm trying to do as well, and getting the same outcome. Any help? kumpelblase2 IDragonfire
    As a side note, my version has max distance set at 25, but the animal teleports to me around 11 - 12ish blocks away.

    Vivaax Go to the bukkit dev page and download the version there to fix the sheep swim init thing. I had that same issue when downloading the one linked in the first post.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
    Vivaax likes this.
  7. Offline

    Vivaax

    Thx. The error disappeared now, but the sheep is still not following me. :(
     
  8. Offline

    Aqua

    No idea why I get this error.. But here it is:
    Code:
    20:36:44 [SEVERE] net.minecraft.server.v1_6_R2.ReportedException: Ticking entity
     
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.MinecraftServer.t(Minecr
    aftServer.java:576)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.DedicatedServer.t(Dedica
    tedServer.java:226)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.MinecraftServer.s(Minecr
    aftServer.java:486)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.MinecraftServer.run(Mine
    craftServer.java:419)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.ThreadServerApplication.
    run(SourceFile:582)
    20:36:44 [SEVERE] Caused by: java.lang.NullPointerException
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.nms.PlayerNavigation.d
    (PlayerNavigation.java:73)
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.nms.PlayerNavigation.a
    (PlayerNavigation.java:90)
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.api.thinking.goals.Des
    ireKillTarget.shouldExecute(DesireKillTarget.java:64)
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.api.thinking.DesireSel
    ector.onUpdate(DesireSelector.java:49)
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.api.thinking.Mind.tick
    (Mind.java:390)
    20:36:44 [SEVERE]      at de.kumpelblase2.remoteentities.entities.RemotePlayerE
    ntity.l_(RemotePlayerEntity.java:91)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.World.entityJoinedWorld(
    World.java:1354)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.World.playerJoinedWorld(
    World.java:1335)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.World.tickEntities(World
    .java:1223)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.WorldServer.tickEntities
    (WorldServer.java:480)
    20:36:44 [SEVERE]      at net.minecraft.server.v1_6_R2.MinecraftServer.t(Minecr
    aftServer.java:572)
    20:36:44 [SEVERE]      ... 4 more
    20:36:44 [SEVERE] Encountered an unexpected exception ReportedException
    net.minecraft.server.v1_6_R2.ReportedException: Ticking entity
            at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:5
    76)
            at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:2
    26)
            at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:4
    86)
            at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java
    :419)
            at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:5
    82)
    Caused by: java.lang.NullPointerException
            at de.kumpelblase2.remoteentities.nms.PlayerNavigation.d(PlayerNavigatio
    n.java:73)
            at de.kumpelblase2.remoteentities.nms.PlayerNavigation.a(PlayerNavigatio
    n.java:90)
            at de.kumpelblase2.remoteentities.api.thinking.goals.DesireKillTarget.sh
    ouldExecute(DesireKillTarget.java:64)
            at de.kumpelblase2.remoteentities.api.thinking.DesireSelector.onUpdate(D
    esireSelector.java:49)
            at de.kumpelblase2.remoteentities.api.thinking.Mind.tick(Mind.java:390)
            at de.kumpelblase2.remoteentities.entities.RemotePlayerEntity.l_(RemoteP
    layerEntity.java:91)
            at net.minecraft.server.v1_6_R2.World.entityJoinedWorld(World.java:1354)
     
            at net.minecraft.server.v1_6_R2.World.playerJoinedWorld(World.java:1335)
     
            at net.minecraft.server.v1_6_R2.World.tickEntities(World.java:1223)
            at net.minecraft.server.v1_6_R2.WorldServer.tickEntities(WorldServer.jav
    a:480)
            at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:5
    72)
            ... 4 more
    Happens around this code:
    Code:
        private void setBehav(final Player player){
            herobrine.getMind().addMovementDesire(new DesireLookAtSpecific(player, 10F), 1);
            herobrine.getMind().addTargetingDesire(new DesireKillTarget(player), 1);
            herobrine.getMind().addMovementDesire(new DesireFollowSpecific(player, 0.1F, 75F), 2);
            herobrine.getMind().addBehaviour(new DamageBehavior(herobrine) {
                @Override
                public void onDamage(EntityDamageEvent entityDamageEvent) {
                    Entity ent = entityDamageEvent.getEntity();
                    Bukkit.getWorld(player.getWorld().getName()).playEffect(ent.getLocation(), Effect.MOBSPAWNER_FLAMES, 3);
                    herobrine.despawn(DespawnReason.DEATH);
                    Bukkit.getWorld(player.getWorld().getName()).playSound(player.getLocation(), Sound.ENDERMAN_STARE, 500F, 1.5F);
                }
            });
        }
    EDIT: Server freezes and crashes.
     
  9. Offline

    kumpelblase2

    Jenkins is running again, at least for now. Latest snapshot is also deployed so you might want to try out that one and it probably already fixes some issues.
     
    TheGreenGamerHD likes this.
  10. Offline

    Aqua

    kumpelblase2
    Code:
    12:59:43 [SEVERE] Error occurred while enabling RemoteEntities v1.8-SNAPSHOT (Is it up to date?)
    java.lang.ExceptionInInitializerError
            at de.kumpelblase2.remoteentities.RemoteEntities.onEnable(RemoteEntities.java:33)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(CraftServer.java:282)
            at org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(CraftServer.java:264)
            at net.minecraft.server.v1_6_R2.MinecraftServer.l(MinecraftServer.java:313)
            at net.minecraft.server.v1_6_R2.MinecraftServer.f(MinecraftServer.java:290)
            at net.minecraft.server.v1_6_R2.MinecraftServer.a(MinecraftServer.java:250)
            at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.java:151)
            at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:391)
            at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
    Caused by: java.lang.NullPointerException
            at de.kumpelblase2.remoteentities.api.RemoteEntityType.<init>(RemoteEntityType.java:53)
            at de.kumpelblase2.remoteentities.api.RemoteEntityType.<clinit>(RemoteEntityType.java:9)
            ... 12 more
     
  11. Offline

    Raemis

    kumpelblase2 Used latest snapshot,
    Code:java
    1. pet.getMind().addMovementDesire(new DesireFollowSpecific(owner, 5, 25), 20);

    And the pet stands still, unless I get 16 blocks away, at which point he teleports to me.

    Yeah, Vivaax, I'm getting the same thing, if I get a solution, I'll try to remember to tag you.
     
    Vivaax likes this.
  12. Offline

    slasheh

    When I spawn in my mob and it kills me, after I respawn it doesn't attack me anymore. Is there any reason to this? I set the kill desire towards players but it just stands still and doesn't move.

    Edit: Heres my code
    Code:
            for(Entity entity : newMob.getBukkitEntity().getNearbyEntities(100, 100, 100)){
                if(entity instanceof Player){
                    Player player = (Player)entity;
                    newMob.getMind().addTargetingDesire(new DesireKillTarget(player), 1);
                    newMob.getMind().addMovementDesire(new DesireMoveToLocation(player.getLocation()), 2);
                }
            }
     
  13. Offline

    Brendyn Todd

    Do you get any errors? There is a problem with the Lib that creates [SEVERE] Reached end of stream for null errors that stop npcs from interacting completely. I do believe they had a fix but I've tried it with the new release and it still produces that error.

    UPDATE:
    After a bit of testing, I find to only reach the [SEVERE] error when spawning humans. Other entities spawn but move very slowly. If you watch you may notice very very small movements every few ticks.
     
  14. Offline

    slasheh

    Brendyn Todd
    No errors, the mob doesn't move at all. I made a look desire and it executes but the target and move desires don't execute at all.
     
  15. Offline

    ayden1232

    How do I make it so it doesn't despawn all the animals on plugin reload/restart?
     
  16. Offline

    unrealdesign

    NOt sure if this is still active, but a minor change. In the original post in the area about the code you have the line:

    RemoteEntity entity = manager.createEntity(RemoteEntity.Zombie, Bukkit.getWorld("world").getSpawnLocation(), false);

    But RemoteEntity.Zombie isn't an enum, and needs to be RemoteEntityType.Zombie. Also, thanks for the great LIB :D !!
     
  17. Offline

    unrealdesign

    I have a small question. I've been looking around and I saw you have a JumpChecker class, but I can't figure out how to use it. I want to restrict the entities that I spawn from jumping. Any help would be very helpful!! Thanks in advance! :)
     
  18. Offline

    IDragonfire

    RemoteEntity.x changed from an enum to static fields (RemoteEntityType.x)
     
  19. Offline

    kumpelblase2

    Aqua fixed in later snapshots.
    slasheh kill target only tries to kill the target until the target is dead. When the target is dead, there's no reason to continue trying to kill it right? That's why it only does its job ones and then removes itself from the entity.
    Also, it should be set as a movement desire, not targetting, because it moves and attacks, not just sets the player as target.
    ayden1232 You can't, you'd have to save and load them.
    unrealdesign The jumpchecker will be used for future custom pathfinding, but has no use currently. Apart from that, you can't restrict it currently I'm afraid.
    desht I added a custom sound api in the latest snapshots, but I can't support every sound even though I tried to add as many as I could. (click)

    Also I would be really happy if you could make a ticket on github when you have an error or any other sorts of issue(s) or improvements. This not only makes the thread cleaner but also really helps me keeping track of everything. Right now, I would have to go though all the pages every time I could do something, but can't remember which one I fixed already and which one I didn't. So yeah...
    It would be a timesaver for me. Thank you.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
    unrealdesign and desht like this.
  20. Offline

    MrSoLegitimate

    Needs alot of work on the DesireFollowTamer and DesireHelpAttacking desires. Only some entites will actually follow the tamer (e.g spider), and the only entity that i've seen to actually help attack is the skeleton.
     
  21. how can i make a silverfish going to the location im pointiong at while holding a carrot on a stick? (simulate pig driving...)
    i have code right now but its only push (velocity) the silverfish that im riding on ... cant figure how to get the pathdinfer :(
     
  22. Offline

    xxNightlordx

    The .move(Location loc) does not work. It returns a nullpointerexception
     
  23. Offline

    Cirno

    Not sure if this is a known issue or not, but if I spawn an NPC, they sometimes refuse to look at me. No notifications at all either. I noticed it happens if the NPC had already existed but then was removed and then re-inserted.
     
  24. Offline

    kumpelblase2

    Infinity_Crafter There's a desire for that: DesireFollowCarrotStick, haw you tried that out?

    xxNightlordx Please make a ticket on github and a stacktrace would be helpful

    Cirno What do you mean by refuse? Like that they don't always look at you? Or they don't look at you at all?
     
  25. Offline

    Cirno

    I have to relog to get them to look at me.
    edit: It looks like I have to move completely away to get it the NPC to look at me; fixed I guess :p
     
  26. kumpelblase2
    i did tried it.. i dont know how to use it tho... i made the npc with that desire and make another "class" that let me ride mobs when right click on them... after it i tried to use carrot on a stick.. doesnt seems to work :(
    what do i do wrong?
    edit: btw.. how can i remove remote entities?
     
  27. Offline

    CaptainBern Retired Staff

    Is it possible to obtain a bukkit entity of a remoteentity? Like when you create a player npc you can obtain the bukkit entity from that npc?
     
  28. Offline

    Cirno

    RemoteEntity.getHandle().getBukkitEntity();
     
    CaptainBern likes this.
  29. Offline

    CaptainBern Retired Staff

  30. Offline

    Jake0oo0

Thread Status:
Not open for further replies.

Share This Page