private PacketContainer newDisplaySlotPacket(DisplaySlot displaySlot) {
        // http://wiki.vg/Protocol#Display_Scoreboard
        PacketContainer packet = new PacketContainer(PacketType.Play.Server.SCOREBOARD_DISPLAY_OBJECTIVE);

        // set position
        final int slot;
        switch (displaySlot) {
            case PLAYER_LIST:
                slot = 0;
                break;
            case SIDEBAR:
                slot = 1;
                break;
            case BELOW_NAME:
                slot = 2;
                break;
            default:
                throw new RuntimeException();
        }

        packet.getIntegers().write(0, slot);

        // set objective name - The unique name for the scoreboard to be displayed.
        packet.getStrings().write(0, getId());

        return packet;
    }
Creates a new scoreboard objective

@param id the id of this objective
@param displayName the initial display name
@param displaySlot the initial display slot
helper/src/main/java/me/lucko/helper/scoreboard/PacketScoreboardObjective.java