Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Parties

Vrekt edited this page May 29, 2020 · 2 revisions

This will probably be incomplete but will give you a pretty good idea of how things work.

If you use common sense you can find most stuff out by just checking methods within athena.party()

Or, ask me on discord @ vrekt#4387 :)

Joining a party

// athena.build()....

// First, register whatever class you want as your Party listener.
athena.party().registerEventListener(this);
// Next, set your character CID.
athena.party().setCharacter("CID_158_Athena_Commando_F_StarsAndStripes");

// ....

// Now add your event listeners, don't forget your @PartyEvent
    @PartyEvent
    public void onPing(PartyPingEvent event) throws Exception {
        event.joinParty();
    }

    @PartyEvent
    public void onMemberJoined(PartyMemberJoinedEvent event) {
        if (event.displayName().equalsIgnoreCase(athena.displayName())) {
            // we joined!
            event.party().chat().sendMessage("Hey!");
        }
    }

Creating your own party

            athena.party().createParty(PartyPrivacy.PUBLIC);
            athena.party().invite("accountId");

            athena.party().setCharacter("CID_158_Athena_Commando_F_StarsAndStripes");

Setting your character skin

athena.party().setCharacter("character ID");

Setting your contrail

athena.party().setContrail("contrail ID");

Setting your backbling

athena.party().setBackpack("backpack ID");

Setting your pickaxe

athena.party().setPickaxe("pickaxe ID");

Setting your banner

athena.party().setBanner("iconId", "colorId", seasonLevelNumber);

Set game status

athena.party().setReadiness(GameReadiness.READY);
athena.party().setReadiness(GameReadiness.NOT_READY);
etc...

Set input type

athena.party().setInputType(Input.KEYBOARD_AND_MOUSE);

Set battlepass

athena.party().setBattlePass(true, 100, 100, 100);

Set playlist

athena.party().setPlaylist("Playlist_PlaygroundV2", "", "", "NAE");

Set custom key

athena.party().setCustomKey("CustomKey");

Set squad fill

athena.party().setSquadFill(true);

Events example

You can find the list of events here.

Not all events are listed in this example.

// make sure you have this
// ... athena.party().registerEventListener(this);

    @PartyEvent
    public void onPing(PartyPingEvent event) {
        // join the party
        // its best to use ping bc its always gonna fire
        // invite only fires once
        event.joinParty();
    }

    @PartyEvent
    public void onMemberJoined(PartyMemberJoinedEvent event) {
        System.err.println("Member: " + event.displayName() + " joined.");
    }

    @PartyEvent
    public void onMemberLeft(PartyMemberLeftEvent event) {
        System.err.println("Member: " + event.accountId() + " left.");
    }

    @PartyEvent
    public void onMemberUpdated(PartyMemberUpdatedEvent event) {
        final var party = event.party();
        // invoked when a member changes something about them like their cosmetics, readying up, etc.
    }

    @PartyEvent
    public void onMemberPromoted(PartyMemberNewCaptainEvent event) {
        if (event.localAccountPromoted()) {
            // we were promoted, lets kick everybody because why not
            event.party().kickAll();
            // change stuff
            event.party().setPlaylist("Playlist_PlaygroundV2");
            event.party().setCustomKey("Hey");
        }
    }

    @PartyEvent
    public void onPartyUpdated(PartyUpdatedEvent event) {
        // do something
    }