[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

    SuperOriginal

    kumpelblase2 Do you have an idea why the isRemoteEntity() method isn't working?
     
  2. Offline

    Quaro

    supercube101 Maybe you are using it on creatureSpawnEvent ?
     
  3. Offline

    itzrobotix

    kumpelblase2How would I set up wether a remote entity was right clicked is it an event? Does it go in the onEnable? How do I check for right click, the Javadocs was very, unhelpful. Thanks.
     
  4. Offline

    itzrobotix

    How do you do it?
     
  5. Offline

    Buizelfan2

    How did I do the shop thing?
    Villager Spawning:
    Code:java
    1. public void spawnVillager() {
    2. Location loc1 = new Location(Bukkit.getWorld("world"), 448.37535, 136.000, 578.52853);
    3. Location loc2 = new Location(Bukkit.getWorld("world"), 422.35386, 136.000, 578.48277);
    4. EntityManager manager = RemoteEntities.createManager(this);
    5. RemoteEntity creative = manager.createEntity(RemoteEntityType.Villager, loc1, false);
    6. RemoteEntity survival = manager.createEntity(RemoteEntityType.Villager, loc2, false);
    7. creative.setSound(EntitySound.RANDOM, null);
    8. creative.setHeadYaw(89);
    9. creative.setPushable(false);
    10. creative.getBukkitEntity().setCustomName("§2Join Creative");
    11. creative.getBukkitEntity().setCustomNameVisible(true);
    12. survival.setSound(EntitySound.RANDOM, null);
    13. survival.setHeadYaw(-89);
    14. survival.setPushable(false);
    15. survival.getBukkitEntity().setCustomName("§2Join Survival");
    16. survival.getBukkitEntity().setCustomNameVisible(true);
    17. }


    Interacting:
    Code:java
    1. @EventHandler
    2. public void openShop(RemoteEntityInteractEvent e) {
    3. Player p = e.getInteractor();
    4. RemoteEntity entity = e.getRemoteEntity();
    5. if (entity.getName() == "§2Join Survival") {
    6. e.setCancelled(true);
    7. shop.showS(p);
    8. } else if (entity.getName() == "§2Join Creative") {
    9. e.setCancelled(true);
    10. shop.showC(p);
    11. }
    12. }
     
  6. Offline

    itzrobotix

    And do you have this in a listener class or? P.S Thanks!
     
  7. Offline

    Buizelfan2

    I do have this for the shop

    Code:java
    1. public class Shop implements Listener {
    2. private Inventory shop;
    3. private Inventory shop2;
    4. public static Mobs plugin;
    5. private ItemStack c, s;
    6.  
    7. public Shop(Plugin p) {
    8. shop = Bukkit.getServer().createInventory(null, 9, "Join Survival");
    9. shop2 = Bukkit.getServer().createInventory(null, 9, "Join Creative");
    10. s = createItem(Material.EYE_OF_ENDER, 1, (short) 0, "§3Survival Server", "§fJoin, Survive, And Have Fun!");
    11. c = createItem(Material.EYE_OF_ENDER, 1, (short) 0, "§3Creative Server", "§fJoin, Be Creative, And Have Fun!");
    12. shop.setItem(4, s);
    13. shop2.setItem(4, c);
    14. Bukkit.getServer().getPluginManager().registerEvents(this, p);
    15. }
    16.  
    17. private ItemStack createItem(Material material, int amount, short shrt, String displayname, String lore) {
    18. ItemStack item = new ItemStack(material, amount, (short) shrt);
    19. ItemMeta meta = item.getItemMeta();
    20. meta.setDisplayName(displayname);
    21. ArrayList<String> Lore = new ArrayList<String>();
    22. Lore.add(lore);
    23. meta.setLore(Lore);
    24.  
    25. item.setItemMeta(meta);
    26. return item;
    27. }
    28.  
    29. public void showS(Player p) {
    30. p.openInventory(shop);
    31. }
    32.  
    33. public void showC(Player p) {
    34. p.openInventory(shop2);
    35. }
     
  8. Offline

    lx3krypticx

    When I despawn the entity (Human) it dosn't dissapear for the other players. Any fix?
     
  9. itzrobotix See this: https://github.com/kumpelblase2/Remote-Entities/commit/52dc678f2e6b826561b603c43a9968cfbdd3a9b3 there is no way for a right click right now.
    Apart from that the RemoteEntityInteractEvent is just another event that gets handled via the bukkit event system.


    On a bigger note: This is the last time I'm going to provide support over the bukkit forums.

    Over the last year, the execution of policies that the bukkit team created were, in my eyes, not really good and for me wrong to some extend, and I haven't seen any kind of possibility to even make a suggestion that doesn't get turned down immediately. If you disagree with that, fine, but this is how I've seen it and that is what matters to me. As a result of all this, it is no longer a pleasure for me stay on the forums any longer if they continue like they did until now and thus I will no longer be around here.

    I know that bukkit was the primary source of issue reports, a help place and news for RE but this will no longer be the case. However, this doesn't mean I will drop supporting RE completely. No, every other kind of communication, such as IRC, github or wherever you'll find me I'll respond, just not on the bukkit forums.
     
  10. Offline

    TnT

    Locked as the author no longer wishes to utilize these forums.
     
    Ultimate_n00b likes this.
Thread Status:
Not open for further replies.

Share This Page