Maven compile error: cannot access n.m.s.v1_11_R1.PacketPlayOutPlayerInfo.PlayerInfoD

Discussion in 'Spigot Plugin Development' started by Martiii, Apr 13, 2017.

  1. Hi spigot comunity,

    Today I was trying to modify tablist entries but I couldn't compile my plugin using Maven. I got this error:
    cannot access net.minecraft.server.v1_11_R1.PacketPlayOutPlayerInfo.PlayerInfoData
    Full error log.
    My code:
    Code (Java):

    PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo();
    try {
        Field a = packet.getClass().getDeclaredField("a");
        a.set(packet, PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER);
        Field b = packet.getClass().getDeclaredField("b");
        List<PacketPlayOutPlayerInfo.PlayerInfoData> dataList = Lists.newArrayList();
        dataList.add( PlayerInfoData(new GameProfile(UUID.randomUUID(), "Test"), 0, EnumGamemode.ADVENTURE, IChatBaseComponent.ChatSerializer.a("{\"text\":\"Test\"}")));
        b.set(packet, dataList);
        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
    } catch (Exception e) {
    The error points at this line:
    Code (Java):
    List<PacketPlayOutPlayerInfo.PlayerInfoData> dataList = Lists.newArrayList();
    There are other types of packets in the same project, but this is the only one that can't be compiled.
    I have the craftbukkit dependency in my pom.xml:
    Code (XML):

    I've already run again BuildTools but I get the same error.
    Can you check if you get the same error?