The constructor PlayerInfoData is undefined

Discussion in 'Spigot Plugin Development' started by shawshark, May 1, 2015.

  1. Hello, i'm using code that was working in 1.8 but suddenly is now broken in 1.8.3, I'm getting this error in eclipes: "The constructor PacketPlayOutPlayerInfo.PlayerInfoData(PacketPlayOutPlayerInfo, GameProfile, int, null, null) is undefined"

    this is the code i'm using:
    Code (Text):
        public boolean removeallatonce() {
            PacketPlayOutPlayerInfo remove = new PacketPlayOutPlayerInfo();
            boolean done = false;
             try {
                 Field a = remove.getClass().getDeclaredField("a");
                 a.set(remove, EnumPlayerInfoAction.REMOVE_PLAYER);
                 Field b = remove.getClass().getDeclaredField("b");
                 List<PlayerInfoData> datalist = Lists.newArrayList();
                 Iterator< profile > profile = getUserProfiles().iterator();
                 while(profile.hasNext()) {
                    profile user =;
                    if(getInstance().getServer().getPlayer(user.getUser()) != null) continue;
                    PlayerInfoData data = user.getData();
                    GameProfile gprofile = data.a();
                    datalist.add(new PacketPlayOutPlayerInfo.PlayerInfoData(remove, gprofile, -1, null, null));
                    b.set(remove, datalist);
                done = true;
             } catch (Exception e) {
                 done = false;
             for(Player player : getInstance().getServer().getOnlinePlayers()) {
                 CraftPlayer craftplayer = (CraftPlayer) player;
                 PlayerConnection connection = craftplayer.getHandle().playerConnection;
             return done;
    I'm getting the error on this line
    Code (Text):
    datalist.add(new PacketPlayOutPlayerInfo.PlayerInfoData(remove, gprofile, -1, null, null));
  2. gigosaurus


    The constructor is now
    Code (Text):
    GameProfile p2, int p3, EnumGamemode p4, IChatBaseComponent p5
    so change that line to
    Code (Text):
    datalist.add(new PacketPlayOutPlayerInfo.PlayerInfoData(gprofile, -1, null, null));
  3. That doesn't seem to work, i get this error in eclipes,
    Code (Text):
    No enclosing instance of type PacketPlayOutPlayerInfo is accessible. Must qualify the allocation with an enclosing instance of type PacketPlayOutPlayerInfo (e.g. A() where x is an instance of PacketPlayOutPlayerInfo).
  4. Create an instance of the packet, and then create the PlayerInfoData as
    Code (Java): PlayerInfoData(params);
  5. Doesn't work,
    I get this in eclipes when trying "Packet.PlayerInfoData cannot be resolved to a type" and this is the code
    Code (Text):

     PlayerInfoData data = new PlayerInfoData(profile, 10, EnumGamemode.SURVIVAL, ChatSerializer.a(name));
  6. gigosaurus


    Oops, thought the inner class was static.

    -_- really? You can't work out that you have to put "remove" instead of "packet", because you named your packet "remove"?
    Code (Java):

    datalist.add( PlayerInfoData(gprofile, -1, null, null));
    #6 gigosaurus, May 2, 2015
    Last edited: May 2, 2015