Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Load, modify & save the user in LuckPerms.
- api.getUserManager().modifyUser(player.getUniqueId(), (User user) -> {
- // Remove all other inherited groups the user had before.
- user.data().clear(NodeType.INHERITANCE::matches);
- // Create a node to add to the player.
- Node node = InheritanceNode.builder(group).build();
- // Add the node to the user.
- user.data().add(node);
- // Tell the sender.
- if (debug) {
- Logger.info(user.getUsername() + " is now in group " + group.getDisplayName());
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement