-
How can I listen for multiple types of events on one node? I want to listen for |
Beta Was this translation helpful? Give feedback.
Answered by
zax71
Dec 18, 2023
Replies: 1 comment
-
// Filter if the event is an instanceEvent happening in our instances or a minigameEvent on this minigame
eventNode = EventNode.event(getName(), EventFilter.ALL, (Event event) -> {
if (event instanceof InstanceEvent instanceEvent) {
return getInstances().contains(instanceEvent.getInstance());
}
if (event instanceof PlayerMinigameEvent minigameEvent) {
return minigameEvent.getMinigame().equals(getName());
}
return false;
}); This is what I ended came up with after some help from other Minestom people :) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zax71
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is what I ended came up with after some help from other Minestom people :)