#Catching events from FTB Teams

5 messages · Page 1 of 1 (latest)

nova hound
#

Hi ! Sorry if this is not directly related to KubeJS, but as your mod allows the developer to do sooo much things, there is a world where KubeJS is the solution to my problem.

Let me explain :
I want to catch events from joining or creating a team with FTB Teams to be able to automatically change the gamemode of the player (to adventure to survival).

My knowledge in events is currently very limited as it is the first time I'm playing with. I asked a few times for help in the FTB discord server but can't get any answers as my messages are constantly getting lost among the ocean of support requests, and I think its common sense to not harass developers and support team. Also the wiki of FTB Teams is so empty we can't even consider that there is one.

I don't know either the whole potential of your mod, but I want to give it a try. I'm crossing fingers because if even you don't have a trail for this, I don't know where to go 🤞.

Anyway, thanks for any help :D.

Bwapt

devout flameBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

nova hound
#

By searching in the source code on Github, I found this :

public class TeamEvent {
    public static final Event<Consumer<TeamCreatedEvent>> CREATED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamEvent>> LOADED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamEvent>> SAVED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamEvent>> DELETED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<PlayerLoggedInAfterTeamEvent>> PLAYER_LOGGED_IN = EventFactory.createConsumerLoop();
    public static final Event<Consumer<PlayerTransferredTeamOwnershipEvent>> OWNERSHIP_TRANSFERRED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamCollectPropertiesEvent>> COLLECT_PROPERTIES = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamPropertiesChangedEvent>> PROPERTIES_CHANGED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<PlayerChangedTeamEvent>> PLAYER_CHANGED = EventFactory.createConsumerLoop();
    public static final Event<Consumer<PlayerJoinedPartyTeamEvent>> PLAYER_JOINED_PARTY = EventFactory.createConsumerLoop();
    public static final Event<Consumer<PlayerLeftPartyTeamEvent>> PLAYER_LEFT_PARTY = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamInfoEvent>> INFO = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamAllyEvent>> ADD_ALLY = EventFactory.createConsumerLoop();
    public static final Event<Consumer<TeamAllyEvent>> REMOVE_ALLY = EventFactory.createConsumerLoop();

    public static final Event<Consumer<ClientTeamPropertiesChangedEvent>> CLIENT_PROPERTIES_CHANGED = EventFactory.createConsumerLoop(ClientTeamPropertiesChangedEvent.class);

    private final Team team;

    public TeamEvent(Team team) {
        this.team = team;
    }

    /**
     * Get the team for which this event pertains to.
     *
     * @return the team
     */
    public Team getTeam() {
        return team;
    }
}```
How can I use them in **KubeJS** ? I thought I was supposed to listen to event like `ftbteams.player_joined_party`, but there is nothing looking like this...
brave hound
nova hound