[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. Infinity_Crafter oh, I'm sorry it's my fault. I need to change something because riding earlier was not supported by everyone when I implemented it.

    CaptainBern Cirno remoteentity.getBukkitEntity() is even shorter.

    Jake0oo0 I checked the server and it's fine. You don't have access to the folder which is normal, but as soon as you want to access a file, you will be able to.
    For the OOM part, I can't say that for sure, but I keep an eye out where those could happen.

    As you might've noticed, development and my assistance have been really limited in the last days and weeks. I know that and I'm not happy about it. The sad truth however is that I can't change it at the moment and probably not in the near future. It's not like I lost interest in doing this or I'm tired of updating the same stuff over and over again, it's more like that I expected to have at least a bit more time in my every day life for projects like this. I didn't expect university taking so much time (not because I have to do so much, in fact, it hasn't even really started yet, but the the way from and to university is the problem) and I didn't expect work to take so much time. In fact, the only real free time I currently have for developing such project is on the weekends where I have to take care of other projects and well, "real-life stuff" also has to be done. To be honest, it could be worse and other people might be complain about my bad time management or that I've made too high expectations and in one way or the other I can't really turn them down.

    The reason now why I write this story is to ask you people out there, who are following this project, if you can help me out, at least for this library, because I think I'm not the only one who want to keep this project alive and running. If you would do that, I would be really grateful for that and I'm pretty sure, other people will be too. I'm not saying that I want someone to completely take this over, which I don't want to happen. I'm more on the lookout for someone that would like to spend his free time doing some work on the library on his own, because like I said, I won't be available often. Sure everyone is still invited to create PRs and issues/feature requests without needing to commit to this project. However, I'm searching for exactly that persons. A person that I could count on when a major bug got discovered and I can't fix it because I'm not there. A person that takes a bit of responsibility to keep this library up to date. A person who knows where to look when an issue gets opened. Again, I might be expecting too much, but that's how I think about it. I would really happy if someone would actually step up and offered a helping hand. It would be cool if we could get in contact with each other.

    Thanks for reading and have a nice day :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 29, 2016
  2. kumpelblase2
    so you wont update this lib anymore? :( even in updates like 1.7? and btw good luck with the university :)
  3. Infinity_Crafter No, I didn't say that. I will continue working on it, but it won't be as frequent as it used to be some time ago.
  4. Offline


    kumpelblase2 How can i use RE to set the item in the hand of a Mob i created with this? Like to set a sword on his hand.
  5. DevRosemberg Get the bukkit entity and then you can use the methods provided by bukkit to set the equipment of it.
  6. Offline


    kumpelblase2 Im getting a NPE when doing this:


    1. public void spawnNPC(String name, Location loc) {
    2. CreateEntityContext c = manager
    3. .prepareEntity(RemoteEntityType.Zombie)
    4. .asPushable(false)
    5. .asStationary(true)
    6. .atLocation(loc)
    7. .withName(name);
    9. RemoteEntity re = c.create();
    10. }

    i alredy did the things of createManager etc

    SpawnStats command:

    1. @Override
    2. public boolean onCommand(CommandSender sender, Command cmd, String Label, String[] args) {
    3. Player p = (Player) sender;
    4. this.plugin.spawnNPC(p.getName(), p.getLocation());
    5. return false;
    6. }
  7. Offline


    1. RemoteEntity ent = man.createNamedEntity(RemoteEntityType.Human, l, "Notch");
    3. ent.getMind().addMovementDesire(new DesireLookAtNearest(Player.class, 8), 0);
    5. ent.getMind().addBehaviour(new InteractBehavior(ent) {
    7. @Override
    8. public void onInteract(Player arg0) {
    9. arg0.sendMessage("hi");
    10. }
    12. });

    While this does create a nice damageable player, I noticed it doesn't look at me or say hi on click.

    Just realized, it throws an error on the create line:
    2:38:19 PM Caused by: java.lang.NullPointerException
    2:38:19 PM at de.kumpelblase2.remoteentities.api.thinking.goals.DesireSwim.<init>(DesireSwim.java:25)
    2:38:19 PM at de.kumpelblase2.remoteentities.entities.RemotePlayerEntity.getDefaultMovementDesires(RemotePlayerEntity.java:226)
    2:38:19 PM at de.kumpelblase2.remoteentities.entities.RemotePlayerEntity.setupStandardGoals(RemotePlayerEntity.java:134)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 29, 2016
  8. There might be some downtime today because the server will be moved. I'm sorry for that.
  9. Offline


    I'm having an issue:
    Caused by: de.kumpelblase2.remoteentities.exceptions.NoNameException: Tried to spawn a named entity without name
        at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:130)
        at de.kumpelblase2.remoteentities.EntityManager.createEntity(EntityManager.java:114)
        at ***.******.players.players.Players.createAI(Players.java:56)
        at ***.******.internals.Game.start(Game.java:40)
        at ***.******.maps.MapControl.onCommand(MapControl.java:27)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
        ... 15 more
    Sorry about the **'s in the package names I cant disclose it.

    Here is my code:
    RemoteEntity ent = manager.createEntity(RemoteEntityType.Human, loc);
            AI.put(name, ent);
    I know how the error is being caused, I have looked in the remote entities source code and it contradicts itself.
    It throws an exception is the type has no name. Human has no name.

    If this makes sense, help would be appreciated.
  10. Offline


    Human remote entities must have a name.
  11. Offline


    I cant work out how to set one, as you can see im trying to do ent.setName("")
    Do you have any suggestions?
  12. Offline


    Use entityManager.createNamedEntity().
  13. Offline


    Unfortunately I am still getting an error:
    Caused by: java.lang.NullPointerException
            at de.kumpelblase2.remoteentities.api.thinking.goals.DesireSwim.<init>(D
            at de.kumpelblase2.remoteentities.entities.RemotePlayerEntity.getDefault
            at de.kumpelblase2.remoteentities.entities.RemotePlayerEntity.setupStand
            at de.kumpelblase2.remoteentities.ChunkEntityLoader.spawn(ChunkEntityLoa
            at de.kumpelblase2.remoteentities.ChunkEntityLoader.queueSpawn(ChunkEnti
            at de.kumpelblase2.remoteentities.EntityManager.createNamedEntity(Entity
            at de.kumpelblase2.remoteentities.EntityManager.createNamedEntity(Entity
    The method createNamedEntity is causing the error
    RemoteEntityType type = RemoteEntityType.Human;
            RemoteEntity ent = manager.createNamedEntity(type, loc, name);
            AI.put(name, ent);
    Is my code

  14. Offline


    I've been messing about with this API for a while, and I've yet to find if there's an "easy" way to make an entity able to be ridden like a horse.

    Specifically, how would I go about making a pig ride-able like a horse is? Thanks for any help possible :)
  15. First snapshot with 1.6.4 is out!
  16. Offline


    Awesome! <3
  17. Offline


    How Do i Add Features? I want to Add The Taming Feature. So i Figured it out but my code doesnt work.. http://puu.sh/4wyz5.txt my wolf just doesnt move at all it just sits there and barks... No Errors At all!
  18. Offline


    Exciting... trying to move Herocraft RPG over to use remote entities... it seems awesome.
  19. Offline


    It is very awesome.
  20. Offline


    I am having problems with the latest remote entities jar file and craftbukkit build. Whenever I am in a directory that has spaces (or a directory with a parent directory that has spaces I get the following:

    16:24:02 [INFO] [RemoteEntities] Enabling RemoteEntities v1.8-SNAPSHOT
    16:24:02 [SEVERE] java.io.FileNotFoundException: D:\zombie%20survival%20server\s
    erver1\craftbukkit-1.6.4-R0.1-20130923.182200-5.jar (The system cannot find the
    path specified)
    16:24:02 [SEVERE] at java.util.zip.ZipFile.open(Native Method)
    16:24:02 [SEVERE] at java.util.zip.ZipFile.<init>(Unknown Source)
    16:24:02 [SEVERE] at java.util.zip.ZipFile.<init>(Unknown Source)
    16:24:02 [SEVERE] at java.util.jar.JarFile.<init>(Unknown Source)
    16:24:02 [SEVERE] at java.util.jar.JarFile.<init>(Unknown Source)
    16:24:02 [SEVERE] at de.kumpelblase2.remoteentities.utilities.ReflectionUtil.getMinecraftRevision(ReflectionUtil.java:162)
    16:24:02 [SEVERE] at de.kumpelblase2.remoteentities.RemoteEntities.onEnable(RemoteEntities.java:26)
    16:24:02 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    16:24:02 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
    16:24:02 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
    16:24:02 [SEVERE] at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:282)
    16:24:02 [SEVERE] at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:264)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393)
    16:24:02 [SEVERE] at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    16:24:02 [INFO] null

    So I get past this first error, and I move my server to be in a directory without any spaces. I then get this error:
    16:15:15 [SEVERE] java.lang.ArrayIndexOutOfBoundsException: 0
    16:15:15 [SEVERE] at de.kumpelblase2.remoteentities.utilities.ReflectionUtil.getMinecraftRevision(ReflectionUtil.java:170)
    16:15:15 [SEVERE] at de.kumpelblase2.remoteentities.RemoteEntities.onEnable(RemoteEntities.java:26)
    16:15:15 [SEVERE] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    16:15:15 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
    16:15:15 [SEVERE] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
    16:15:15 [SEVERE] at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:282)
    16:15:15 [SEVERE] at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:264)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393)
    16:15:15 [SEVERE] at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    16:15:15 [INFO] null

    Does anybody know what to do?
  21. Uhh ok I know. I added a small system to get the proper minecraft revision dynamically which I didn't test completely yet. I'll fix it in a bit.

    joemort sorry for that, it's fixed in the newest snapshot.

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


    Anyone know ? So i Figured it out but my code doesnt work..http://puu.sh/4wyz5.txt my wolf just doesnt move at all it just sits there and barks... No Errors At all!
  23. Offline


    Question can i get a Arg and then say Like RemoteEntityType.args[1] ?

    Also This Returns a NPE http://puu.sh/4zWp0.txt

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


    Hi, I managed to spawn a mob, but it doesnt do anything.
    CreateEntityContext ce = manager.prepareEntity(RemoteEntityType.Human).asPushable(false).atLocation(loc).withName(name);
                RemoteEntity re = ce.create();
                re.getMind().addBehaviour(new DamageBehavior(re) {
                    public void onDamage(EntityDamageEvent e) {
                Desire d = new DesireWanderAround();
                re.getMind().addTargetingDesire(d, 100);
                re.getMind().addMovementDesire(new DesireLookAtNearest(Player.class,1F), 10);
    Also how can I detect if the entity is a remoteentity in a EntityDamageByEntityEvent. Ive tried entity instanceof RemoteEntity
  25. Offline


    My NPC won't move, and i've used one of your examples.
    This is the code i'm using:
        EntityManager manager = RemoteEntities.createManager(main);
                        RemoteEntity entity = manager.createNamedEntity(RemoteEntityType.Villager, ((Player) sender).getLocation(), "test");
                        TamingFeature feature = new RemoteTamingFeature();
                        feature.tame((Player) sender);
                        entity.getMind().addMovementDesire(new DesireFollowTamer(5, 15), entity.getMind().getHighestMovementPriority() - 1);
                        entity.getMind().addTargetingDesire(new DesireMakeLove(), entity.getMind().getHighestMovementPriority() + 1);
    It does spawn the mob but it won't move no matter what i do. (Tried different Desires)
    EDIT: It does move, but only when i hit it, and if i do that it stays in the air at the same height.
  26. Offline


    Same issue for me
  27. Offline


    Can this library be used to make Bats and Squids aggressive? I looked into the default Desires for the different monsters and noticed that Squids and Bats have no default desires. Also if I spawn a Bat with no default desires it will still fly around. Is there a way for me to control Bats?

    Also I'm getting this error when spawning a Monster.
    RE: 1.7 (compiled with maven version, server uses 1.7 from the bukkit page)
    CB: 1.6.2R0.1-SNAPSHOT or 1.6.2-1.1-SNAPSHOT
    1. Caused by: java.lang.NullPointerException
    2. at de.kumpelblase2.remoteentities.api.thinking.goals.DesireSwim.<init>(DesireSwim.java:25)
    3. at de.kumpelblase2.remoteentities.entities.RemoteZombieEntity.getDefaultMovementDesires(RemoteZombieEntity.java:134)
    4. at de.kumpelblase2.remoteentities.entities.RemoteZombieEntity.setupStandardGoals(RemoteZombieEntity.java:53)
  28. Offline


    Thank you for fixing the startup issue I was having. However, now I can't get any of my entities to move anymore, they sit around and do nothing. :( I have tried different desires with different entities, and they all just sit there (or move around a tiny bit in circles or something like that). I loved version 1.6, as I used that until I upgraded to 1.8-snapshot due to 1.6.4. Now everything is broken for me.
    njb_said likes this.
Thread Status:
Not open for further replies.

Share This Page