[HELP] FakePlayer

Discussion in 'Archived: Plugin Requests' started by xKoKSii, Dec 11, 2011.

  1. Offline

    xKoKSii

    How do i create an FakePlayer that are can have op permission for example


    i got a lil skript but i wont work


    Code:java
    1.  
    2. public Player xBot(Player p) {
    3. CraftServer cServer = (CraftServer)this.plugin.getServer();
    4. CraftWorld cWorld = (CraftWorld)p.getWorld();
    5. EntityPlayer fakeEntityPlayer = new EntityPlayer(cServer.getHandle().server, cWorld.getHandle(), "xBot", new ItemInWorldManager(cWorld.getHandle()));
    6.  
    7. fakeEntityPlayer.netServerHandler = ((CraftPlayer)p).getHandle().netServerHandler;
    8. Player xBot = (Player)fakeEntityPlayer.getBukkitEntity();
    9. xBot.setDisplayName("xBot");
    10. ((CraftPlayer)xBot).getHandle().name = "xBot";
    11. xBot.saveData();
    12. xBot.loadData();
    13. return xBot;
    14. }

    any Help?
    :)
     

Share This Page