maxmar628

Untitled

Dec 30th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. @EventHandler
  2. public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent e){
  3.  
  4. Player p = e.getPlayer();
  5.  
  6. for(String a : npc.getConfig().getKeys(false)){
  7.  
  8. String bungee = npc.getConfig().getString(a+".bungee");
  9.  
  10. if (e.getRightClicked() instanceof ArmorStand){
  11.  
  12. e.setCancelled(true);
  13.  
  14. ByteArrayOutputStream b = new ByteArrayOutputStream();
  15. DataOutputStream out = new DataOutputStream(b);
  16. try
  17. {
  18. out.writeUTF("Connect");
  19. //out.writeUTF("survival");
  20. out.writeUTF(bungee);
  21.  
  22. }
  23. catch (IOException e1)
  24. {
  25. e1.printStackTrace();
  26. }
  27. p.sendPluginMessage(pl, "BungeeCord", b.toByteArray());
  28. }
  29. }
  30. }
Add Comment
Please, Sign In to add comment