#luckperms-api

1 messages · Page 35 of 1

prime glacier
#

is the groupname

nocturne elbow
#

There you have it, expireAt 0

prime glacier
nocturne elbow
#

O

prime glacier
#

But those are nodes, the user already had

nocturne elbow
#

And what does the add return?

#

The DataResultWhatever

prime glacier
#

Have a minute

#

add is void?

prime glacier
#

I add it with user#getNodes#add

nocturne elbow
#

Oh ffs that's why

#

You don't do that

#

You .data, not .getNodes

#

getNodes is a view of all the nodes the user has, not the actual mappings

#

So modifying the view won't have any effect since it's just that, a view, a "copy"

prime glacier
#

Oh, okey

nocturne elbow
#

With PermissionHolder#data you retrieve the actual mappings that the holder has, so modifying those do take effect

prime glacier
#

okay

uncut fog
#

p

#

alguien me ayuda

#

:;v

nocturne elbow
#

Hola kek @uncut fog

#

En qué te puedo ayudar 👀

clever heron
nocturne elbow
#

Eeh.. querés obtener todos los grupos? O el grupo primario de un jugador?

clever heron
#

Que el administrador de el servidor ponga la variable %rank% en la Scoreboard por ejemplo y salga el rango de el jugador

nocturne elbow
#

Aa

clever heron
#

a

nocturne elbow
#

Eeh para lo que estás necesitando User#getPrimaryGroup te es suficiente

clever heron
#

Es que soy nuevo en esto :u xd
como hago eso xdxd

nocturne elbow
#

"esto" es la LP API?

#

O java en general?

clever heron
#

en el codigo solo es Java, no se como puedo importar en este codigo la Api

#

de LP para usar sus complementos

nocturne elbow
#

!api te aconsejo chequear ambos links, están en inglés pero cualquier navegador moderno te lo puede traducir ¯_(ツ)_/¯

frank driftBOT
clever heron
#

Gracias 2469_xQcL

#

Veré que soy capaz de hacer xd

rose hedge
#

I have imported the class with
import net.luckperms.api.node.*;
Apologies I can't give full code as I'm away from home atm

nocturne elbow
#

I don't know how sponge does it but:
a) Is LuckPerms installed on the server?
b) What version of the API are you compiling against and what version of LP are you using?

rose hedge
#

Yes.
5.1
5.1.107

nocturne elbow
#

Mm

#

!paste please send the server startup logs manythink

frank driftBOT
#
Please use pastebin!

Seeing a paste of the problem makes everything so much easier! Use https://bytebin.lucko.me/ for easy pasting!

For console errors:

Pastebin any relevant segments of the console log. If it's a startup error, this includes the entire startup log!

Other errors:

Pastebin the entire LuckPerms config file (passwords removed) as well as any other relevant files!

nocturne elbow
#

If you can

#

I mean you said you're away rn

rose hedge
#

Um. Might be able to access it from my phone. One sec

#

Can't open it on my phone unfortunately but

frank driftBOT
nocturne elbow
#

I don't see LuckPerms being loaded

#

Again, I don't know how sponge does it, but make sure your plugin depends on LuckPerms (meaning it loads after LP does)

#

It is in the list but your mod/plugin/whatever is loading before LP

rose hedge
#

I'll look into that when I'm back. I think that may be the problem is that it crashes before it loads

#

Yea

#

Well that makes sense over anything else. I'll check how sponge does it

nocturne elbow
#

I mean the FML is loading your mod before loading LP, because there is no trace of LP loading

#

There's got to be a way of telling sponge "my mod/plugin depends on this other one so I have to load after it"

rose hedge
#

There is. Just gotta find it haha

clever heron
#

!help

frank driftBOT
#
Available commands:

!advanced
!api
!argumentbased
!ask
!bulkupdate
!bungee
!cauldron
!chat
!colours
!commandequivalents
!commands
!config
!context
!default
!downloads
!editor
!errors
!essentials
!extensions
!extracontexts
!faq
!helpchat
!inheritance

!install
!locale
!meta
!migration
!notworking
!nowildcard
!pasteit
!permissions
!placeholders
!selfhosting
!stacking
!storage
!suggestions
!switchstorage
!sync
!tracks
!upgrade
!usage
!userinfo
!verbose
!weight
!whyluckperms
!wiki

clever heron
#

!install

frank driftBOT
clever heron
#

Alguien que sepa como usar la Api de luckperms para poder importar los rangos de las personas, es decir, estoy trabajando en un plugin y quiero conectar los grupos de luckperms con el plugin para que los que usen el plugin puedan agregar los grupos de los usuarios a la Scoreboard, no se nada de String y no entiendo para nada las paginas de ayuda de la Api :u

nocturne elbow
#

no se nada de String
qué

clever heron
#

Soy medio pendejo

#

xd

nocturne elbow
#

Siquiera sabes java...?

clever heron
#

Lo basico

nocturne elbow
#

Eeh la LP API es un poco avanzada... vos lo que querés hacer es obtener todos los grupos te un usuario?

clever heron
#

Lo que intento es que por ejemplo en la scoreboard pongan %rank% y salga el rango que tiene el usuario en luckperms

nocturne elbow
#

En la página principal de la API explica cómo obtener una instancia de LP, de ahí obtienes el usuario

#luckperms-api message

clever heron
#

Esto estaba en el ejemplo, lo que no agarra es el luckperms.example

nocturne elbow
#

Necesitas obtener una instancia, un objeto

#

Está mostrado como hacerlo literalmente en la primer página del uso de la API

clever heron
nocturne elbow
#

Mhm

clever heron
#

Hora de aprender más antes de seguir con esto, será mejor xd

#

Gracias por la ayuda

old rapids
#

where can I find information for implementing tab-complete from luckperms on permissions for my plugin?

wild whale
#

Just declare your perms in plugin.yml (or whichever platform equivalent) and LP will automatically learn them

nocturne elbow
#

I think he wants to use whatever LP uses for tab suggestions 🤔

last sequoia
#

is there an event called for when a node expires? i want to do a check when a node expires to see if some conditions are met, and if so then re-give the node

nocturne elbow
#

NodeRemoveEvent should do from what I know, since you can get the node from there and check the expiry time not being 0 and all

#

In other words: no, there isn't an event specifically for expiring nodes lol

crisp aspen
#

how do i got abouting adding someone to a group

rustic laurel
#

With the developer api?

crisp aspen
#

yes

rustic laurel
#

!api

frank driftBOT
rustic laurel
#

These two links contain the knowledge and examples needed

crisp aspen
#

guess i had it partially right

#

i did getData(DataType.NORMAL)

#

wait

#

but seems to be the same thing as data()

#

ill keep looking at the api

#

ah

#

i didnt save

#

i believe that was my issue

#

i am having an issue with suffix and prefix getting to show

#

not sure why

#

ah

#

vault

obtuse jolt
#

!chat

frank driftBOT
#
LuckPerms does not display things in chat!

LuckPerms is only able to send information to formatting plugins so that they display them properly. LuckPerms does not put the prefix in front of your name, you need a chat formatting plugin to do it, and you need Vault. Same goes for the tablist! If the information appears correctly when you run /lp user <user> info, LuckPerms is doing its job!

neon hatch
#

hi there, trying to update from v4 to v5 api and get rid of my legacy expansions, can anyone tell if node.getPermission() was replaced by node.getKey(), just trying to make sure im reading this javadoc right ty

jaunty pecan
#

Yep that's correct

neon hatch
#

thank you

neon hatch
#

v4 -> v5

toxic marlin
#

Does LuckPerms implement Vault?

nocturne elbow
#

Luckperms sends information to vault yis

neon hatch
#

what was v4 method unsetPermission replaced with in v5?

nocturne elbow
#

I think

#

Ignore me lol

neon hatch
#

lol all good im just as confused

sudden pelican
neon hatch
#

thank you very much

nocturne elbow
#

is there any command to set a player's rank time for example / lp user aleejoo parent set vip 10 days?

rocky timber
#

With the dev API?

lucid rapids
#

o/ hope everyone's doing well, question, i have a minigames plugin and i would like to create a context calculator to fetch the player's arena, and whether they are in a lobby, etc.

do i need to add some sort of unique namespace when passing the info to the context consumer?

#

like myminigame_arena instead of just arena

nocturne elbow
#

Imagine not enabling font ligatures smh

#

There is a method just for what you're looking for

lucid rapids
#

wait since when does intellij even have font ligatures?

#

also what's that method c:

nocturne elbow
#

wait since when does intellij even have font ligatures?
Does it matter? Lmao
Settings -> Editor -> Font I think it's in there

lucid rapids
#

oh gotcha

#

do you by any chance know anything about my question? 😄

nocturne elbow
#

On it lmao I don't remember exactly where it is but I know it exists

lucid rapids
#

oh well what does it do though

nocturne elbow
#

fetch the player's arena, and whether they are in a lobby, etc.

#

Basically their current context set

lucid rapids
#

oh so basically collect all their data in a context set?

#

how would i pass that into the consumer though

nocturne elbow
#

Just a question tho, now that I look closely into that screenshot

#

Why are you implementing your own context calculator?

#

The API is the interface you use to work with LuckPerms and LP implements it. Unless you make an entire implementation around it too, it won't be magically invoked 🤔

lucid rapids
#

@nocturne elbow sorry was away, basically one of my users suggested that they would like to give certain permissions if my context is met

frank driftBOT
#

Hey Revxrsal! Please don't tag helpful/staff members directly.

lucid rapids
#

i read the wiki and saw that the context calculator is what is used for that (also checked some examples in the plugin itself like the server and world calculators), so if there's a better/more appropriate way to do it then i am most likely not aware of it 😅

nocturne elbow
#

You can just user.getQueryOptions().context() and check for your contexts

lucid rapids
#

i won't be checking for the context, LP would

#

isn't that how contexts work 😅

nocturne elbow
#

Okay

#

Let me get rid of my headache

#

So you want to implement your own contexts keys and values

#

Right?

lucid rapids
#

yeah i suppose

nocturne elbow
#

Just like Essentials adds their own contexts keys in that screenshot

#

?

lucid rapids
#

yeah precisely

nocturne elbow
#

Okay now we're talking

lucid rapids
#

oh that's actually epic

#

thanks

#

since registering context calculators doesn't require specifying a plugin instance or something, i suppose i need to do something like spleefx_arena instead of just arena?

nocturne elbow
#

No idea lmfao

#

But yeah it's better if you do?

#

I guess?

#

🤷‍♂️

lucid rapids
#

yeah i guess haha

#

tags lucko

#

thanks for the help!

nocturne elbow
#

Np 😁

remote sky
#

How would you register a context?

nocturne elbow
#

ContextManager#registerCalculator(ContextCalculator)?

remote sky
#

Thanks

#

Any java docs on it?

lime rune
#

Fefo is everywhere

nocturne elbow
#

Any java docs on it?
Literally the javadocs lmao

#

📌

#

Fefo is everywhere
@lime rune yes hi

#

Did you know that more than 3 billion devices run Java?

#

@remote sky but you can check ExtraContexts for examples if that's what you want

remote sky
#

Did you know that more than 3 billion devices run Java?
On what devices?

nocturne elbow
#

Oh well

#

Many

#

Including but not limited to Computers, Printers, Routers, Cell Phones, BlackBerry, Kindle, Parking Meters, Public Transportation Passes, ATMs, Credit Cards, Home Security Systems, Cable Boxes, TVs...

remote sky
#

Wowy

#

And does it need many dependencies?

nocturne elbow
#

Not at all, since Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible.

remote sky
#

That’s crazyyy

pearl glen
#

why luckperms doesen´t work in spigot 1.16.1

nocturne elbow
#

it does

#

and #support-1 would be more appropriate if this isn't related to the developer api

knotty river
#

so i want to show duration of temp permission with placeholderapi but due to no async in papi i'll loop all online players and store duration in a map in async runnable that runs every second. Is getting all online player's perm duration every second will have any performance issue with lp?

nocturne elbow
#

Nope, that data is all loaded on memory already so theoretically it takes the same time to access it, and it's blazing fast (theoretically)

#

You should be able to run that synchronously safely

obtuse jolt
#

doesnt luckperms papi expansion alr have one to show duration of temp permission?

nocturne elbow
#

I mean it takes little to no time to access loaded data

#

that runs every second
now with that there will be one single inconsistency

#

Temp perms are "checked" every 3 seconds, so the value shown won't really update every second

#

wait no

#

I'm stupid

knotty river
#

oh there is %luckperms_expiry_time_<permission>%

nocturne elbow
#

ignore that last bit

knotty river
#

and it also uses papi time format which is i need

nocturne elbow
#

||make sure you're using a PAPI dev build||

knotty river
#

i am

nocturne elbow
#

||latest release formats the time wrong||

knotty river
nocturne elbow
#

neato

obtuse jolt
#

idk how papi can pass a release with that bug tbh

nocturne elbow
#

it's been there for ages

dense pollen
#

papi means placeholderAPI?

nocturne elbow
#

Yes

dense pollen
#

ow ok

shrewd kayak
#

does bukkit platform have TristateCheckEvent or some else way to change the permission check result?

obtuse jolt
#

wdym by change the result?

shrewd kayak
#

dynamic change the sender.hasPermission(foobar) returns

obtuse jolt
#

well hasPermission just returns true or false, teh result depends on whether the user is opped and the permission plugin like luckperms

shrewd kayak
#

yes that is

obtuse jolt
#

so if you want to chnage user perms, you have to interface with a permission plugin or create a permission plugin

#

you probably want to do the first option

shrewd kayak
#

I mean use LuckPerms to process hasPermission result

obtuse jolt
#

yea, so you want to use luckperms API to change user/group perms?

shrewd kayak
#

A non-persistent way

obtuse jolt
#

I mean you just set and unset them when you need to, or you can also have timed perms with LP

shrewd kayak
#

But seems if server crashed, the permission won't revoke after server restart

#

*if use set and unset

obtuse jolt
#

your plugin need to have some logic to unset/set upon restart after these situations then

shrewd kayak
#

🤔 But i think if i can register my listener to LuckPerms like EventBus or other something to process every permission checking request in myself plugin is will be more safe.

#

I found LuckPerms have TristateCheckEvent on bungee platform but i can't found it in bukkit one

obtuse jolt
#

so you want to listen to every hasPermssion call

#

or smt

shrewd kayak
#

so you want to listen to every hasPermssion call
@obtuse jolt yes. after LuckPerms

frank driftBOT
#

Hey Ghost_chu! Please don't tag helpful/staff members directly.

obtuse jolt
#

hmm

shrewd kayak
#

Because i still want use LuckPerms to managing most of requests.

obtuse jolt
#

luckperms does have EventBus but idk how you are suppose to hook onto hasPermission call

shrewd kayak
#

So it should like this : hasPermission -> LuckPerms -> Ask my plugin after LuckPerms gives the result(true or false), so i can change the boolean if need -> return

obtuse jolt
#

tbh, I dont think that is a good idea, bcu that will mean LP loses control of perm handling, and what you are doing is basically creating another perm plugin.

#

I also dont see the use case.

#

bcu you should just set the perm correctly using luckperms

shrewd kayak
#

🤔 hmm, i just want control the permission if player in a region like WorldGuard region

obtuse jolt
#

you can use luckperm context

#

!context

frank driftBOT
obtuse jolt
#

!extracontext

frank driftBOT
shrewd kayak
#

ooops

#

thank you anyway, i will look that :)

molten magnet
#

Guys, one question. how to get player group?

molten magnet
#

oh, thanks

nocturne elbow
#

it literally uses the method I sent lol

tawny aurora
#

Hey so I'm trying write a bungeecord plugin with permission checks using luckperms, how would I go about doing that?

nocturne elbow
#

!api check both links 👇

frank driftBOT
tawny aurora
#

ok I think I got it, but now I'm having a dependency issue I have listed Luckperms as a dependcy in bungee.yml and have it installed on the proxy but it cant find it

#
name: CharmojiBungeecord
version: @version@
main: bonn2.charmojibungeecord.Main
depends:
  - Luckperms
#

any idea why this is?

nocturne elbow
#

It's LuckPerms

#

Not Luckperms

tawny aurora
#

oh

#

thanks 🤦‍♂️

nocturne elbow
#

np lol

nocturne elbow
#

🤔

wild whale
#

@nocturne elbow let's move here

nocturne elbow
#

ok.

#

I'm using a LuckPermsAPI plugin

#

to

wild whale
#

!api

frank driftBOT
nocturne elbow
#
import net.luckperms.api.LuckPerms;
import net.luckperms.api.LuckPermsProvider;```
#
    LuckPerms api = LuckPermsProvider.get();```
#

ok?

#
String prefix = metaData.getPrefix();
String suffix = metaData.getSuffix();```
#

how to get the metaData?

#

Why don't you have member role lol

wild whale
#

I wondered that too lol

nocturne elbow
#

i don't know xD

#

!verify

frank driftBOT
#

Sorry! I do not understand the command !verify
Type !help for a list of commands.

nocturne elbow
#

!verify

frank driftBOT
#

Sorry! I do not understand the command !verify
Type !help for a list of commands.

nocturne elbow
#

You get it automatically on join to

wild whale
#

the bot is supposed to give that role to you automatically

nocturne elbow
#

Tho*

#

ok

wild whale
#

but anyways

nocturne elbow
#

@severe bone fix pls

#

How to get the MetaData?

#
https://github.com/lucko/LuckPerms/wiki/Prefixes,-Suffixes-&-Meta```
#

i think this

#

no not this

#

oh

#

:}

#

getPrefix command?

#

That's an API usage example

#

A real example

#

Not a textbook example

#

Thank you so much.

#

I hate textbook examples

#

They suck

#
import me.lucko.lpcookbook.CookbookPlugin;
#

Error

#

and

LuckPerms-Bukkit-5.1.107
#

im using this

#

Uhm.... you're not supposed to import it, but learn from it how it uses the LPAPI

#

Ok.

#
            CachedMetaData metaData = this.luckPerms.getPlayerAdapter(Player.class).getMetaData(p);
            String prefix = metaData.getPrefix();
            String suffix = metaData.getSuffix();
#
    LuckPerms api = LuckPermsProvider.get();
    private final Main plugin;
    private final LuckPerms luckPerms;

    public ChatPrefix(Main plugin, LuckPerms luckPerms) {
        this.plugin = plugin;
        this.luckPerms = luckPerms;
    }
#

and 💥 GG

#

Neato

#

Nope, the plugin is crashed xd

#

What it say

#

i don't want to see because im a cow 😂 so,

#

thank you for help me and the support.

#

ok lol

#

. _.

honest forum
#

Hello, I'm getting User from LuckPerms with UserManager.loadUser(uuid)
But it return something if user already in LuckPerms database. What can I do for checking, is user exists?

nocturne elbow
#

check if the returned user is null?

honest forum
#

how? loadUser returns CompletableFuture<User>, if user is not exist, userFuture.thenAcceptAsync is not called, how I can see 😦

nocturne elbow
#

does it not get called?

honest forum
#

No, because I have this code, that is returning json and if I make request with user that doesn't exist, this code is not called 😦

honest forum
#

Rewrited it to another thread and future.join(), and it seems to be working, now it returns null 🙂

nocturne elbow
#

Rewrote*

honest forum
#

Переписал*

cold zinc
#

How can I set meta of a user or group?

nocturne elbow
#

And it works on both Users and Groups (basically a PermissionHolder)

charred sentinel
#

Hi, in API 5 how ican replace this : Group group = api.getGroupManager().getGroup(usergetPrimaryGroup());

nocturne elbow
#

@charred sentinel you'll want to call PermissionHolder#getInheritedGroups(QueryOptions), it returns a Collection<Group> of all the inherited groups (according to the provided QueryOptions) and it's already sorted according to the inheritance rules (there's a setting in config for that)

#

so you'll have to get the first element in that collection, it'll be the primary group (as a Group)

limber token
#

Hey. Do I need to update/reload something after doing this: https://luckperms.net/wiki/Developer-API-Usage#modifying-usergroup-data ?
The result indicates success, however the permission doesn't show up as set (/lp user username permission info) and Player#hasPermission(String) still returns false.

nocturne elbow
#

Yeah you need to save the user/group

#

UserManager#saveUser(User)

#

Or something like that

limber token
#

ty, I'll have a look

nocturne elbow
#

After adding the node

#

You can also check some "real world examples" on the api cookbook repo

#

📌

limber token
#

thanks :3
UserManager#saveUser(User) is what I was looking for
maybe that should be noted in the wiki entry

wild rune
#

So I'm trying to make a "title" system, where your suffix changes when you're in specific regions, and obviously I don't want the players to have 2 suffixes at the same time, so I'm trying to clear the suffixes with the priority 50, and then setting it again. However, doing this:

plugin.getLuckPerms().getUserManager().modifyUser(eventUser.getUniqueId(), (User user) -> {
  user.data().remove(SuffixNode.builder(user.getCachedData().getMetaData().getSuffixes().get(50), 50).build());
});

followed by

plugin.getLuckPerms().getUserManager().modifyUser(eventUser.getUniqueId(), (User user) -> {
  user.data().add(SuffixNode.builder(ChatColor.WHITE + " (" + getColor() + title + ChatColor.WHITE + ")", (50)).build());
});

doesn't seem to always work, and sometimes the suffixes stick around despite being removed in the first bit of code. Does anyone have any ideas for a workaround?

#

I have also attempted putting them within the same modifyUser() {}, but when I do that, it seems to completely neglect the part where I re-add a suffix to the player

nocturne elbow
#

Well that's a bit of a messy code but I'm not here to bash you.
Just running the second one should do it; chat meta go by weight so adding a chat meta node with the same weight should replace it afaik

#

That's how it works when you run the command tho so it's a bit of a guess, but if not, putting both the node removal and addition under the same modifyUser callable should do it

wild rune
#

See that's what I thought as well, but no, when look up the user's info it will just display 2 different suffixes, both with the priority of 50

#

and like I said, I've already tried putting both under the same modifyUser, which also didn't work :/

#

When I did that, it didn't even add a suffix

nocturne elbow
#

It's just like that but instead of prefix it's suffix

wild rune
#

Wouldn't the user.data().clear(NodeType.PREFIX::matches); part remove all suffixes though? I only want it to clear the ones with the priority of 50

#

because the suffixes on the server are also used for ranks, I just want the "titles" to override them whenever the user is in specified areas

#

unless it only clears the suffixes that are inherited from self and not from parent groups

nocturne elbow
#
  1. PermissionHolder#data() only returns the objects' own nodes.
  2. That you pasted above would clear all prefixes, not suffixes.
  3. To that clear method you are passing a predicate that takes a node. You can evaluate the type of the node (suffix) and the priority of it (50) to only clear all the nodes that match that predicate (it's basically a "test", if it returns true it will be removed, if it returns false it won't).
wild rune
#

1 okay thanks
2 yeah I know, I just copypasted it from the site, didn't bother changing it for the sake of the example

#

3 turns out i've never encountered predicates before, so gonna read up on that

delicate venture
#

I know how to get the permission's expiration time but I want to modify it to month: day, not mins: hours

#

what I should do

nocturne elbow
#

what?

delicate venture
wild whale
#

Are you trying to do this programatically via the API?

nocturne elbow
#

I really don't get what you're trying to do

delicate venture
#

not only API , i just want to know how to do

obtuse jolt
nocturne elbow
#

How to check a permission node for a offline player

rustic laurel
#

load the player

#

!api

frank driftBOT
nocturne elbow
#

What if the player is already loaded?
Like so I have to do any checks

rustic laurel
#

offline players are not loaded

#

if they're in memory as online then you can just check them

nocturne elbow
#

hmm ok

nocturne elbow
#

who ghost messaged manythink

ebon ether
#

👻

granite field
#

erm how to check if a player/offlineplayer has or inherit a specific permission?

UserManager userManager = LuckPermsProvider.get().getUserManager();
User u1 = userManager.loadUser(p1.getUniqueId()).join();

then...?

nocturne elbow
#

You'll want to create a copy of the node you want with Node.Builder btw

#

And compare with that one

granite field
#

ok thanks 🙂

nocturne elbow
#

np

nocturne elbow
#

Honestly, for something like that, your best bet is to do it through Vault instead, and LP will take care of all the meta-formatting (stacking), settings-dependent variables, etc.

#

Disappointing, I know lol

#

But believe me, in regards to that, Vault is what you want to use

#

Any reason in particular?

#

You can do in here

nocturne elbow
#

getPlayerPrefix will get it from the group if the user inherits the group

#

Not only the user's own prefix

#

@halcyon minnow

#

.. TextComponent component = new TextComponent(prefix + p.getName() + msg);

#

because nowhere in there you have a variable named prefix

#

You'll want to call Vault's Chat#getPlayerPrefix(Player) to get the prefix, put it in a string and add it to the component

#

Just like, in that event listener method, you are making a player variable p and a string variable msg, you need a string variable prefix, whose value you get by getting it from Vault

nocturne elbow
#

You are trying to use legacy color codes (the ones with the § thingy) with the new BaseComponent system

#

Just by themselves, they are incompatible, but thankfully there is a method that lets you translate legacy formatted text to the new system

#

Okay, you are doing BaseComponent[] bc = TextComponent.fromLegacyText(msg); as you said

#

So you have a bc variable

#

What are you doing with it?

#

because you are converting and sending the msg alone

#

without the prefix and name

#

You will want to do something like String fullMessage = prefix + name + msg; and then do TextComponent.fromLegacyText(fullMessage); and send that to the player

#

Because as of right now, you are discarding the other component (with prefix and name)

#
String fullmess = prefix + p.getName() + msg;
msg = msg.replace("testcmd", "§e§lTEST");

Do you see what you're doing here?

#

And that's something you are doing wrong

#

Order of operation matters in here

#

You are first creating fullmess and then replacing the original msg with TEST

#

fullmess doesn't know about the changes you made to msg

#

So you have to do it before you create fullmess

#

yes

#

show a screenshot of what you see in chat and what you type

#

The & are not valid color chars

#

You need to ChatColor.translatewhatever and then feed it into the TextComponent thing

wicked kiln
#

i don't recommend PlugMan it breaks some plugins

nocturne elbow
#

Not on prod at least

#

For testing is me

#

But what which color codes do I have to translate?
the prefix

#

lel

frank driftBOT
#

Hey Trippyn! Please don't tag helpful/staff members directly.

scarlet oasis
#

Hi ! how can I get the groups of a player disconnect?

nocturne elbow
#

@scarlet oasis you hook to LP, get the user manager, call UserManager#loadUser(UUID), that returns a CompletableFuture<User> so you may want to know how to work with that (see https://github.com/lucko/LuckPerms/wiki/Developer-API#using-completablefutures for more info), and from the retrieved user instance you call getInheritedGroups(QueryOptions) https://javadoc.io/static/net.luckperms/api/5.1/net/luckperms/api/model/PermissionHolder.html#getInheritedGroups-net.luckperms.api.query.QueryOptions-

scarlet oasis
#

Thx you ^^ !

turbid solar
wispy harness
#

What is the best way to listen to parent updates?

nocturne elbow
#

Subscribe to the NodeAddEvent/NodeRemoveEvent and check for the target type, node type, etc...

wispy harness
#

Ahh ty

#

Is there a good documentation about all the existing events?

nocturne elbow
#

!api

frank driftBOT
wild whale
#

javadocs pinned 😛

wispy harness
#

Ty

#

Ah yeah javadocs are better xd

nocturne elbow
#

Second link in there explains how to subscribe to events

#

And yeah javadocs 📌

wispy harness
#

Yeah I.k, just searching for the javadocs 😉

#

Thanks alot! 😉

nocturne elbow
#

And a couple examples in the api cookbook repo too (also pinned lol)

wild whale
wispy harness
#
                eventBus.subscribe(NodeAddEvent.class, e -> {
                    if (!(e.getTarget() instanceof User)) return;
                    User user = (User) e.getTarget();
                    LinkedPlayer.get(user.getUuid()).recheckRoles();
                    System.out.println("Added node to " + user.getName());
                });```  
What I'm I doing wrong, its subscribing 100% sure of that but not logging anything. (Bungeecord)
While I do receive the following message in my console:
> >.... [19:22:43 INFO] [LuckPerms]: [Messaging] Received user update ping for 'iflyinqmc' with id: e087a461-5ec2-427a-a092-0131332feed8
nocturne elbow
#

How do you know it's subscribed if it doesn't print the thing?

#

🤔

#

Hmm mmmmmmmmmmm?

wispy harness
#

How do you know it's subscribed if it doesn't print the thing?
I mean, its executing the code (Logged a message just above the line and underneeth) so I guess its subscribing 😮

nocturne elbow
#

What command did you run and where?

wispy harness
#

And no exceptions shrug

#

What command did you run and where?
In the lobby, /lp user iFlyinqMC parent add Builder

#

Nothing happened shrug

nocturne elbow
#

Hint hint NodeMutateEvent never gets called so you can discard that one

wispy harness
#

NICE! 😂

#

Just to test anyways but, thanks for the tip 🙂

nocturne elbow
#

Humm are you sure those subscribe calls are.. well.. being called?

#

Oh wait a second

#

I know

wispy harness
#

This obviously works 😂

nocturne elbow
#

Most events are only called by the platform instance for the subscriptions on that platform. Meaning Bungeecord LP will not trigger events that happened on other servers (such as NodeAddEvent)

#

Run the command from proxy LP

#

It will trigger

wispy harness
#

I just saw that UserLoadEvent does trigger it so I think I'll just use that

nocturne elbow
#

Yeah that's not really the best way to go but I mean you do you . _.

wispy harness
#

but why is that being called 2000 times 😂

nocturne elbow
#

Because

#

It does stuff lmao idk

#

Some events are called each time something happens, and some of those happen a lot of times for the same action

wispy harness
#

O wow, I just remade my whole system to realize that only pings will be sent from ppl whose are online

nocturne elbow
#

huh?

dark robin
#

hello

#

i'm really having trouble setting a player's primary group with the api, anyone knows a sollution?

#

ill send my code

#

Perms.setRank(Perms.getUser(p), Perms.api().getGroupManager().getGroup(args[1]).getName().toLowerCase());

#

I'm using this to set the player's group, perms class:

nocturne elbow
dark robin
#

i'm not sure what that means

nocturne elbow
#

It means User#setPrimaryGroup(String) may or may not have effects

#

Depends on the settings

dark robin
#

I'm using setPrimaryGroup

#

hmm

#

oh

#

mb

nocturne elbow
#

oh yea

#

mb

#

what is it you want to achieve?

dark robin
#

I'm trying to make a command to set a player's rank

#

for testing purposes only

#

i also tried setting a rank when a player joins, but that doesn't seem to work either

dark robin
#

I'll try this and i'll come back if it doesn't work

#

Thank you

#

Yep, i'm using the same method yet it still doesn't work

#
    public static void setRank(User p, String r){
        api().getUserManager().modifyUser(p.getUniqueId(), (User user) -> {

            user.data().clear(NodeType.INHERITANCE::matches);

            Group group = api().getGroupManager().getGroup(r);
            Bukkit.getPlayer(p.getUsername()).sendMessage(group.getName());
            Node node = InheritanceNode.builder(group).build();

            user.data().add(node);

            if(Bukkit.getPlayer(p.getUsername()) != null) {
                Bukkit.getPlayer(p.getUsername()).sendMessage(ChatColor.RED + user.getUsername() + " is now in group " + group.getName());
            }
        });
    }``` this is the method
nocturne elbow
#

why dont you use the java code block

dark robin
#

yea im trying it rn

nocturne elbow
#

```java
Code here
```

dark robin
#

oh

#

mb

nocturne elbow
#

Nah its fine

#

its just easier to read

dark robin
#

yeye

#

i tried copy pasting the whole command fefo sent

#

i'll see if that works

#

it doesn't work either

#

odd

#

nevermind

#

it does

#

thank you a lot @nocturne elbow

frank driftBOT
#

Hey noobdog! Please don't tag helpful/staff members directly.

nocturne elbow
#

:d

nocturne elbow
#

hi, is there any even for when a player's group is changed? i wanted to update the player's tab displayname whenever his group is changed (i.e: if player is in group member, his tabdisplay shows &7 + p.getName() and after i change his group to vip, tab shows &a(VIP) + p.getName())

#

NodeAddEvent is what you're looking for

#

so

#

and in there you check the target, type of node, etc

#

i do public void onGroupChange(NodeAddEvent e)

#

?

#

!api check both of these links, there's a special section explaining how to subscribe (listen) to events

frank driftBOT
nocturne elbow
#

ah

#

but

#

?

#

can you just please tell me how to do it

#

ive been working on this plugin for past

#

10 hours

#

giving me a link wont help atm

#

:))

#

it will if you read it thoroughly and properly

#

it shows you how to listen to LP events

#

where exactly

#

i cant find it

limber token
#

In that case you should take a break for now

nocturne elbow
#

yea ik but its that last thing i have to do

#

ty

#
public NodeAddListener(RohiHubCore plugin) {
        this.plugin = plugin;

        EventBus eventBus = api.getEventBus();
        eventBus.subscribe(LogPublishEvent.class, e -> e.setCancelled(true));
        eventBus.subscribe(UserLoadEvent.class, e -> {
            System.out.println("[Rohi] User " + e.getUser().getUsername() + " was loaded into the database!");
        });
    }

    private void onUserPromote(UserPromoteEvent event) {
        Bukkit.getScheduler().runTask(plugin, () -> {
            Bukkit.broadcastMessage(event.getUser().getUsername() + " was promoted to" + event.getGroupTo().get() + "!");

            Player player = Bukkit.getPlayer(event.getUser().getUniqueId());
            if (player != null) {
                Scoreboard s = Bukkit.getScoreboardManager().getMainScoreboard();
                s.getTeam(api.getUserManager().getUser(player.getUniqueId()).getPrimaryGroup()).addEntry(player.getName());
                player.setPlayerListName(ChatColorTranslator.color(LuckPermsUtils.getPrefix(api.getUserManager().getUser(player.getUniqueId()))));
            }
        });
    }
#

i tried this but it doesnt work

#

it crashed the server

#

share the crash log then?

wispy harness
#

huh?
@nocturne elbow That LP only send update pings to the proxy if the target player is online.

frank driftBOT
#

Hey iFlyinq! Please don't tag helpful/staff members directly.

wispy harness
#

Sorry for tag, the quote feature did that automatically on phone ☹️

nocturne elbow
#

I'm trying to fix to open chests but default players can't open chests 😦

obtuse jolt
#

you are using luckpermsAPI?

nocturne elbow
#

Luckperms plugin

#

Idk what you mean with API

#

but ok

obtuse jolt
#

means you aare not

remote sky
#

Lmao

vestal cipher
#

How can I add a user to a group (non-primary) using the LP api?

#

what's the api equivalent of this? /lp user/group <user|group> parent add <group> [context...]

nocturne elbow
#

you could just use Bukkit.dispatchCommand()

#

lol

#

to run a command as console ^

vestal cipher
#

using dispatchcommand is usually bad practice when there's an api method to do it directly

nocturne elbow
#

Hey I mean... it is an api method

#

just not luckperms

vestal cipher
#

oh?

#

is it not possible with lp the api then?

nocturne elbow
#

This might be what youre looking for

#

I've honestly never used the LP api

vestal cipher
#

Read through the API docs and I can't find what node/values I should add

obtuse jolt
#

!api it does explain

frank driftBOT
obtuse jolt
nocturne elbow
#

hi

#

is this support channel???

#

For the developer API, yes

#

oh ok

#

so i have a problem on my server

#

basically, i have a scoreboard in the hub and i have placeholderAPI installed and i have ran the command to install the luck perms extension, and it is not working, i only installed the extention in the hub but i plan to install it on other servers too... the server is running bungee... i have %Luckperms_prefix% showing in my scoreboard... please help someone

#

do i need to get a bungee version of placeholderAPI and install it on the bungee server??

#

This isn't related to the dev api...

#

is this support channel???
@nocturne elbow

#

For the developer API, yes
@nocturne elbow

frank driftBOT
#

Hey ejclayton36! Please don't tag helpful/staff members directly.

nocturne elbow
#

how is this related to the dev api?

#

well sorry... can someone tell me the support channel then please : )

last merlin
#

how do you checkif someone has a suffix

#

tried to do if(api.getUserManager().getUser(player.getName()).getCachedData().getMetaData().getSuffix() == null)

#

but you cant do that

#

xD

nocturne elbow
#

which part you can't do

#

I mean if you already have the player object, you can simply pass the UUID instead

last merlin
#

oh it works

#

tf

#

cheers

nocturne elbow
#

lol

silver sleet
#

How could I get all the groups a player inherits directly?

#

I've tried user.getInheritedGroups but that returns the groups inherited from other groups as well

nocturne elbow
#

Then you didn't try hard enough :d

#

You pass a QueryOptions object to that method

#

And in those query options, you can set it to not resolve inheritance (i.e. ignore what the holder's parent groups inherit)

silver sleet
#

Thanks

dull egret
#

how can I get a group prefix

#

I've tried with this peace of code

public static String getPrefix(Player player) {
        try {
            if (Bukkit.getServer().getPluginManager().getPlugin("LuckPerms") == null)
                return "";
            final LuckPermsApi lpAPI = LuckPerms.getApi();
            User user = lpAPI.getUser(player.getUniqueId());
            Contexts userCtx = lpAPI.getContextForUser(user).get();
            return ChatColor.translateAlternateColorCodes('&', user.getCachedData().getMetaData(userCtx).getPrefix());
        } catch (Throwable e) {
            return "";
        }
    }

but it doesn't work

nocturne elbow
#

LuckPermsApi?

dull egret
#

ya

nocturne elbow
#

What version are you working with?

dull egret
#

5.1

nocturne elbow
#

:doubt:

#

That's not v5

dull egret
#
<dependency>
            <groupId>net.luckperms</groupId>
            <artifactId>api</artifactId>
            <version>5.1</version>
            <scope>provided</scope>
        </dependency>
#

I've also tried wwith version 4.4

nocturne elbow
#

Well try clearing your IDE cache, because it's still using the v4 API

dull egret
#

ok

nocturne elbow
#

make sure you refresh maven when you make changes to pom.xml

dull egret
#

by restart the ide right?

nocturne elbow
#

I mean that will do the job

dull egret
#

done

nocturne elbow
#

wait wtf

#

I meant invalidate caches

dull egret
#

are ya using intellij?

nocturne elbow
#

are you?

dull egret
#

yea

nocturne elbow
dull egret
#

oh lo l

nocturne elbow
#

go to file -> invalidate caches

dull egret
#

done

nocturne elbow
#

see if it gives you the v5 api

dull egret
#

yes sir

nocturne elbow
#

did it work

dull egret
#

yea

nocturne elbow
#

sik

dull egret
#

so erm

#

how to get the group prefix

nocturne elbow
#

read the docs

dull egret
#

ok

#

my friend did it like this

LuckPermsProvider.get().getGroupManager().getGroup(LuckPermsProvider.get().getUserManager().getUser(player.getUniqueId()).getPrimaryGroup()).getCachedData().getMetaData().getPrefix()

#

but that's for bungee

nocturne elbow
#

you realise it uses the same methods

dull egret
#

but when I paste that code in I get an error

nocturne elbow
#

whats da error

dull egret
#

nvm I'm an idiot

#

I forgot a ;

nocturne elbow
#

?

#

classic

dull egret
#

xD

#

ikr

#

Thank you for helping me 🙂

nocturne elbow
#

no worries

last merlin
#

how can you delete someones suffix? or set

nocturne elbow
last merlin
#

ty @nocturne elbow

frank driftBOT
#

Hey Mal! Please don't tag helpful/staff members directly.

ripe stirrup
#

So I'm looking to find the highest rank a player has on a certain track is this possible? I've looked through the api and it doesn't seem like a simple task unless someone has some guidance.

nocturne elbow
#

You'll need to get the user's parent groups (only the ones they directly inherit), filter those that the track contains and get the one with the highest weight

#

Take a look in the javadocs at PermissionHolder#getInheritedGroups(QueryOptions) and at the QueryOptions themselves too, in there you can specify a flag to only get the holder's own parent groups

ripe stirrup
#

for the queryOptions do I just do User#getqueroptions?

nocturne elbow
#

For the most part yes, but you'll still need to apply this flag I mentioned

#

I think QueryOptions#toBuilder is a thing, then you can add the flag, and re-build it

ripe stirrup
#

Thank you I got it working

nocturne elbow
#

coolio

ripe stirrup
#

ok I was wrong I didn't debug enough what is the flag for the parent groups because I tested all the flags and nothing will come up unless I have all the flags there

ripe stirrup
#

ok do i need to put other flags with that? because on its own it returns nothing

nocturne elbow
#

tried setting it to false?

#

mind showing your code rn?

ripe stirrup
#
        Set<Flag> flags = new HashSet<>(Arrays.asList(Flag.RESOLVE_INHERITANCE));
        QueryOptions queryOptions = target.getQueryOptions().toBuilder()
                .flags(flags)
                .build();
        Collection<Group> groups = target.getInheritedGroups(queryOptions);```
#

you said try false?

ripe stirrup
#

I wanted to test 1 by 1

nocturne elbow
#

if you simply put it in a set, means it's true

ripe stirrup
#

ok and I want only this one as false?

nocturne elbow
#

you need to use that method specifically to set it to false

#

yep

ripe stirrup
#

yeah I saw that, but I thought I only wanted that flag as true not only that flag as false and by default they're all true and I didn't want to do .flag 5 times

#

testing it now will let you know

nocturne elbow
#

just set that one to false

#

no need to change the other ones

ripe stirrup
#

wow I feel dumb now thank you that worked

nocturne elbow
#

lmao

marsh matrix
#

I'm confused. I get this error randomly sometimes
Caused by: com.google.common.util.concurrent.ExecutionError: com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: Lnet/luckperms/api/LuckPerms;
I did not touch the LP jar
I did not touch anything to do with LP in the code, and I've put LP as a dependency

nocturne elbow
#

What LP version do you have installed on your server and what API version are you building your plugin for?

#

The version on your server -> /lp info

marsh matrix
#

compileOnly "net.luckperms:api:5.1"

#

issue is, I didn't touch anything, and it just borks sometimes on reboot

nocturne elbow
#

"sometimes"?

marsh matrix
#

yes, I'm coding a plugin, and sometimes it just errors like that

#

this is the whole main class

nocturne elbow
#

dependencies = @Dependency(id = "luckperms")
I don't know how sponge dependencies work but wouldn't it be "LuckPerms" instead of "luckperms"? Correct me if I'm wrong

marsh matrix
#

it's the plugin ID

#

plugin IDs should be lowercase

nocturne elbow
#

oh okay

#

this is the whole main class
looks reasonable

marsh matrix
#

I'm so confused lol

nocturne elbow
#

only sometimes it throws?

marsh matrix
#

only when I edit something even if it doesn't even touch LP

nocturne elbow
#

aaa I see the issue

marsh matrix
#

last time I fixed it by using GamePostInitEvent instead of GameInitializationEvent

nocturne elbow
#

(well I think, again, idk sponge lmao)

marsh matrix
#

but even then @Dependency should fix it

nocturne elbow
#

try doing it like this

dependencies = {
        @Dependency(id = "luckperms")
}
#

it's an array, not a single one

marsh matrix
#

tbf I already used it in the past (if you search that error in that chat here the only msg is from me, and doing it like what I did worked); imma try and see

timid spear
#

Asking here then

#

How can I listen/subscribe to a player changing from one group to antoher, it isn't promote or demote

#

Thought it'd be ContextChange but that didn't work out either

nocturne elbow
#

no, those are for the individual user .. promote/demote commands

#

you're looking for NodeAddEvent

#

check that the target is a user and the node added is of NodeType.INHERITANCE (basically, a group)

timid spear
#

NodeAddEvent for /lp user <name> parent set <group>?

nocturne elbow
#

yep

timid spear
#

KK

#

love ya

nocturne elbow
#

ily2

marsh matrix
#

ah yes now it works lovely

nocturne elbow
#

:^)

marsh matrix
#

why did it work before then lmfao

nocturne elbow
#

¯_(ツ)_/¯

#

sponge

timid spear
#

check that the target is a user and the node added is of NodeType.INHERITANCE (basically, a group)
@nocturne elbow How exactly do I check the user, sorry for the ping

frank driftBOT
#

Hey infintyz! Please don't tag helpful/staff members directly.

timid spear
#

welp

#

I did apologize

marsh matrix
#

anyways, thx fefo xD

nocturne elbow
#

lmao

timid spear
#

I assume e.getTarget and then?

nocturne elbow
#

e.isUser will do

timid spear
#

didn't see it lmao

#

I need the user though, how can I get a player instance from there?

nocturne elbow
#

I need the user though, how can I get a player instance from there?
well after confirming it's a user, simply cast the target into a user

#

User user = (User) event.getTarget();

timid spear
#

got that far, then user.getUniqueId() I suppose

nocturne elbow
#

I mean if you want to get the uuid...

timid spear
#

Yeah that works for me

#

Thanks

#

you're the best

nocturne elbow
#

ofc 😎

marsh matrix
#

Guess what

#

the error came back

nocturne elbow
#

:bruh:

marsh matrix
#

and the only thing that I added is a sout in a completely different class

#

literally added just this

nocturne elbow
#

uuh how does your @Plugin thingy look like?

marsh matrix
#
@Plugin(
        id = "battletower",
        name = "BattleTower",
        description = "gew",
        authors = {
                "gse"
        },
        dependencies =  {
                @Dependency(id = "luckperms")
        }
)```
nocturne elbow
#

```java
// :d
```

marsh matrix
#

I don't have this ` in my keyboard so I use discord's button to highlight it

#

mb

nocturne elbow
#

o

#

uuuhh yeah no idea tbh lol what's the full error?

marsh matrix
#

ok you want to know what fixed it this time?

nocturne elbow
#

hm?

marsh matrix
#
@Plugin(
        id = "battletower",
        name = "BattleTower",
        description = "gew",
        authors = {
                "gse"
        },
        dependencies =  {

                @Dependency(id = "luckperms")
        }
)```
#

that space

#

I've added a space and the server started

nocturne elbow
#

🤷‍♂️

marsh matrix
#

lovely stuff

devout snow
#

I have a quick question regarding the Event API. Is there an event to listen for a player parent group change that does not happen through the promotion track? The UserPromoteEvent only happens when the track is followed.

nocturne elbow
devout snow
#

Oh sweet, thanks

nocturne elbow
#

Np

torn ember
#

I only want to know if I only need to use mysql if I want to do so every server have the samething whit roles and permission

nocturne elbow
frank driftBOT
nocturne elbow
#

@next orchid you can (and should, given the design of the api 👀) user.data().clear(NodeMatcher.key("kit.Nitro"))

#

lmao it's been 3.5 hours

marble lichen
#

Hello i'm searching to get all users which have a group. So, i got the group but now i'm kinda stuck on how to get those players.
Is it possible ? If yes, how ?

nocturne elbow
#

Hmmmmm

#

UserManager#searchAll(NodeMatcher) might be what you're looking for @marble lichen

marble lichen
#

okay, thanks 🙂

hasty coral
#

is there any way to set uuid in bungeecord?

nocturne elbow
#

?

#

wdym?

hasty coral
#

i'm making a plugin to check if player is premium and then autologin (on offline server)

#

but when i do the check in PreLoginEvent with setonlinemode(true) i have a online uuid so i set it in offline in LoginEvent

#

so now in hub I have offline uuid but in bungeecord now I have 2 different uuids, offline and online, and luckperms go mad

#

is there any way to prevent it?

nocturne elbow
#

I mean if you're having an online / offline UUIDs mismatch between Bungeecord and the backend servers, you should probably double check your network settings.. you know the drill, make sure bungee config.yml has ip_forward and online_mode set to true, backend servers spigot.yml have bungeecord set to true too, etc

hasty coral
#

no... can i share my desktop?

nocturne elbow
#

you actually can't lmao

hasty coral
#

:/

#

anydesk?

nocturne elbow
#

uhm no thanks

hasty coral
#

mh.. i'll try to explain better 😂

nocturne elbow
#

if you're having an online / offline UUIDs mismatch between Bungeecord and the backend servers, you should probably double check your network settings
I mean.. that's as much as there is to it

hasty coral
#

but i need a offline network not online

#

where who wants more protection can set online his account

#

like premiumlock

nocturne elbow
#

yeah..... I don't know about you but I'm not up for piracy; besides, in my experience, offline mode always brings issues (like, uh, this one lmao)
so.. yeah, sorry, not sorry

#

but when i do the check in PreLoginEvent with setonlinemode(true) i have a online uuid so i set it in offline in LoginEvent
@hasty coral this is going to cause so many issues

#

So what happens if the user logs in on a cracked account after logging in with premium?

hasty coral
#

he can't login

nocturne elbow
#

Good luck with that bud

hasty coral
nocturne elbow
#

What happens if someone with their name joins before they log in with a premium account?

#

Also thats just the message from the hacked client. Not your plugin

hasty coral
#

yes, but is the same with regular client

#

but this is not the problem

nocturne elbow
#

I can see so many UUID issues

#

Already

#

Just have a normal server

#

Or get everyone to log in

hasty coral
#

there is no way to fix it?

#

because at the moment i have online uuid saved in bungeecord and offline uuid in other servers inside bungee

nocturne elbow
#

Idk it just seems like I dumb idea

#

because at the moment i have online uuid saved in bungeecord and offline uuid in other servers inside bungee
@hasty coral thats every normal bungeecord network

#

not really

hasty coral
#

i can't pass a modified uuid to bungeecord?

#

o.O

nocturne elbow
#

not really
@nocturne elbow um.. yes it is

frank driftBOT
#

Hey Tim__! Please don't tag helpful/staff members directly.

misty hinge
#

uuid spoofing afaik

nocturne elbow
#

How u gonna modify a UUID

#

because at the moment i have online uuid saved in bungeecord and offline uuid in other servers inside bungee
how is that every normal bungeecord network?

#

setting bungeecord to true (and offline mode to false) makes spigot fetch the UUIDs through proxy

#

and if proxy says "I'm online mode" it'll be a type 4 uuid

hasty coral
nocturne elbow
#

I love how people use code blocks for words 😂 like why say bungeecord

#

Habit?

#

because it's a setting..

#

So why not say true ¿¿

narrow mica
#

this is the line

nocturne elbow
#

Did you add "LuckPerms" into your plugins' depends list in bungee.yml?

narrow mica
#

sorry, where is this file?

nocturne elbow
#

It can also be plugin.yml on bungee too

#

👀

narrow mica
#

this?

nocturne elbow
#

yessir

#

Then you're most probably shading the LP API into your plugin (i.e. including it with your jar)

#

And class loader go brrrrrrrrrr

#

How are you building your plugin?

narrow mica
#

maven clean package

nocturne elbow
#

alrighty, mind sharing your pom.xml?

narrow mica
#

no problem give me a second

nocturne elbow
#

damn

#

v4

#

lmao what version of LP are you running on your proxy server?

#

also, add this to the LP dependency entry <scope>provided</scope>

#

Might want to consider upgrading to v5.2 lmao

narrow mica
nocturne elbow
#

yea

#

defo also update the dependency version to 5.2

narrow mica
#

lol I didn't know that the api was the same version of the plugin

nocturne elbow
#

also, add this to the LP dependency entry <scope>provided</scope>
do this pls

narrow mica
#

okay

nocturne elbow
#

lol I didn't know that the api was the same version of the plugin
yep, and v5 (in general) was a complete overhaul to the API so there are quite large differences between v4 and v5 APIs

narrow mica
#

Ok hahaha, then in version I put 5.2 right?

rustic laurel
#

defo also update the dependency version to 5.2

narrow mica
#

thanks @nocturne elbow GhostHeartsS

frank driftBOT
#

Hey 𝗢𝗻𝗹𝘆𝗦𝗼𝘆𝗼☯! Please don't tag helpful/staff members directly.

nocturne elbow
#

kek

worn grotto
#

hey so obviously this works:

        List<Integer> amounts = new ArrayList<>();
        for (PermissionAttachmentInfo permissionAttachmentInfo : islandLeader.getPlayer().getEffectivePermissions())
        {
            String permission = permissionAttachmentInfo.getPermission().toLowerCase();
            if (permission.startsWith("permission.perm."))
            {
                Integer parseInt = Integer.parseInt(permission
                        .replace("permission.perm.", ""));
                amounts.add(parseInt);
            }
        }

But this obviously doesn't work as soon as the player is offline so how would I do that?

nocturne elbow
#

> so obviously this works
> But this obviously doesn't work

rustic laurel
#

load the player

#

!api

frank driftBOT
rustic laurel
#

it's on one of these links

nocturne elbow
#

I mean that's not using any of the LP API lmao

#

that's pure Bukkit perms API

rustic laurel
#

i suppose it would still be needed lol

#

also why superperms api when you can just use LPaPI

nocturne elbow
#

LarryPerms API

charred fulcrum
#

I use minecraft version 1.12.2 which LP ver 5.0 doesn't support. So I use ver 4.0 and the LP doesn't support it (You have very old / outdated version of LuckPerms installed on your server. end of this month. Please update to the new version of LuckPerms as soon as possible to continue using the online applications.)
Is there any way to use it on minecraft 1.12.2?

wild whale
#

This is not a support channel.

nocturne elbow
#

I mean

wild whale
#
  • This is not a support channel for general support things
rustic laurel
#

i stg if I was watching this at the moment instead of having a snacc things wouldve ended differently KEKW

nocturne elbow
#

was it good?

rustic laurel
#

it was a couple of individual uncooked spaghetti

#

absolutely fantastic

nocturne elbow
#

lolll

dusk saffron
#

how do i give the player a group for a certain time?

#

(ping me)

dusk saffron
#

thx

nocturne elbow
#

(the last one is an example on how to add a node, so mix and match the links provided above with what the example shows)

dusk saffron
#

yea

dusk saffron
#

i dont see any expiry function on InheritanceNode?

jaunty pecan
#

InheritanceNode.Builder extends from NodeBuilder 🙂

dusk saffron
#

hmm

#

i just see getExpiry() getExpiryDuration() hasExpired() and hasExpiry()

#

also hi luck lol

jaunty pecan
#

hey

#

yea, that's because you are looking at InheritanceNode and not InheritanceNode.Builder

#

to create a new node, you use the builder (and it's methods) before calling .build() to get the result

dusk saffron
#

ahh ok thanks

jaunty pecan
#

you can't modify an existing node directly, you have to call node.toBuilder().changeSomething().build()

#

which will return a new node containing your changes

#

in other words, nodes are immutable :))

dusk saffron
#

k

#

what is long measured in? server ticks? milliseconds?

dusk saffron
#

thx

#

epoch ok

#

sooo milliseconds?

jaunty pecan
#

expiryEpochSeconds is the parameter name, so :p

dusk saffron
#

hmm

#

oh

#

wait is that

#

oh

#

seconds i can totally read

jaunty pecan
dusk saffron
#

ah k

jaunty pecan
#

if you just want to set a duration relative to the current time, I suggest using the other methods

dusk saffron
#

soo if 24 hours is 86400 seconds, i should put 86400?

#

i just want to create one for 24h

jaunty pecan
#

e.g. expiry(Duration.ofHours(24))

dusk saffron
#

ah thanks

jaunty pecan
#

Duration is java.time.Duration iirc

dusk saffron
#

k

#

thx

#

*hoping it will actually compile and run without errors*

jaunty pecan
#

np haha

dusk saffron
#

you can't call yourself a real developer if you haven't had tons of tabs open lmao

severe pawn
#

(should see my brothers brower, more tabs than that

dusk saffron
#

XD

worn grotto
#

@nocturne elbow it does work but i was literally asking about converting it to lp api because i need to work with offline players...

frank driftBOT
#

Hey Terminated! Please don't tag helpful/staff members directly.

nocturne elbow
#

If you need to cast an OfflinePlayer to a Player to have access to the Permissible methods while the player is offline, yeah that doesn't work lmao

marble lichen
#

Yesterday i asked a question about how to remove a rank for all people having a permission / rank.
So today, i tried this http://prntscr.com/v3ax1o but the map always empty. I don't really understand why, maybe i'm not NodeMatcher#key ?

Lightshot

Captured with Lightshot

nocturne elbow
#

I mean, I really doubt there are users with that permission, hence the resulting collection being empty

#

You'll avoid mistakes like that one with it :d since all you give it is the group name

snow willow
#

How do I get the prefix

#

It doesnt Matter if I get it by the user or the group

turbid solar
#

!api read wiki

frank driftBOT
nocturne elbow
#

I think there is an example of exactly that in the API cookbook repo 📌

snow willow
#

I think there is an example of exactly that in the API cookbook repo 📌
@nocturne elbow The way its done in the wiki doesnt work or Im too stupid xD

frank driftBOT
#

Hey Hallo5000! Please don't tag helpful/staff members directly.

snow willow
#

Oh okay^^

nocturne elbow
#

Uuh the way done in the wiki? Or the way shown in the repo?

snow willow
#

In the wiki ...can you send a link pls

nocturne elbow
snow willow
#

okay thx

#

Why I cant use the getPlayerAdapter Class?

nocturne elbow
#

How are you retrieving it?

snow willow
#

The way its done in the cookbook repo but now I've found a new way like this: String pr = Main.loadUser(p).getCachedData().getMetaData(QueryOptions.defaultContextualOptions()).getPrefix();

#

But I dont know wich QueryOption I should use....?

nocturne elbow
#

Isn't User#getQueryOptions() a thing?

#

Why I cant use the getPlayerAdapter Class?
I don't really know what you mean by that btw

snow willow
#

The "QueryOptions.defaultContextualOptions()" in my example is more like an placeholder I dont know what I should insert there

#

...and sorry for my english skills xD

nocturne elbow
#

And what I meant by that is that you should be able to use a method named getQueryOptions() you can call on a user instance to replace your placeholder

snow willow
#

So I tried it and it doesnt work ... my IDE doesnt know this Method...and I think it doesnt exist too

nocturne elbow
#

Mind pasting the exact code you're typing?

#

Because the method clearly does exist

snow willow
#

Oh okay so I think it was added in one of the newer versions I used 5.0.88

#

But I will update it

nocturne elbow
#

Yeah you'll definitely want to update, LP is currently on 5.2.14 I think

#

And that method was introduced on v5.1

snow willow
#

Okay fine than I know whats the problem ...thx for the help

nocturne elbow
snow willow
#

Okay I think the only problem is my deprecated version of the api

#

isnt it?

nocturne elbow
#

Well the API version isn't the problem, but between v5.0 and v5.2 there have been hundreds of builds, including bugfixes

#

So it can be a known issue on the version that you're using that's been fixed later on

snow willow
#

But the method were talking about isnt in my version so I cant use it

nocturne elbow
#

Then... update luckperms?

snow willow
#

Yes

nocturne elbow
#

!update you can get the latest build in here

frank driftBOT
primal spire
#

I need some advice.
So I'm hoping to make a highly configurable plugin relating to upgrading towns with the Towny plugin. I have quite a bit done on it, except I have this "addPerms" option in my config in which I want to add permissions to certain town ranks for a certain town upon upgrading to a certain level (Ex: once a town reaches level 2, give the mayor of that town the permission "ah.sell.5" and give the residents of that town the permission "essentials.fly").

I was thinking I'd use LuckPerms to simply dispatch a command through console after cycling different ranks, but if there was a large town with say 100 members that was deleted and I needed to remove 5 perms from each of those 100 players, it'd definitely cause some lag. Do you guys have any ideas that would allow me to implement this addPerms option using LuckPerms API that might cause less lag? Please tag me in your response and thank you in advance for your help!

nocturne elbow
#

Why would removing perms cause lag

wild whale
#

^
Everything that can be async, is.