#(danjoe3) Luckperms with Denizen
215 messages · Page 1 of 1 (latest)
(danjoe3) Luckperms with Denizen
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
!t luckperms.list_groups
Returns a list of all luckperms groups.
Depenizen, LuckPerms
ListTag(LuckPermsGroupTag)
!t Format Script Containers
Multiple possible tags: <LocationTag.format[<format>]>, <ElementTag.format[<format_script>]>, <TimeTag.format[(<format>)]>, <ItemTag.formatted>, <LocationTag.formatted>, <ListTag.formatted>, <DurationTag.formatted>, <ElementTag.end_format>, <ElementTag.format_number[(<format>)]>, <server.economy.format[<#.#>]>, <TimeTag.format_discord[(<style>)]>, <PlayerTag.formatted_money>, <DurationTag.formatted_words>, <LocationTag.simple.formatted>, <EntityTag.formatted_health>, <LocationTag.formatted.citizens>, <PlayerTag.formatted_food_level[(<max>)]>.
!l Format Script Containers
Format script containers are very simple script containers used for formatting messages, usually with the 'narrate' command.
Format_Script_Name:
type: format
# The only key is the format. The format can use '<[text]>' as a special def to contain the message being sent.
# '<[name]>' is available as a special def as well for use with the 'on player chats' event to fill the player's name properly.
# Note that 'special' means special: these tags behave a little funny in certain circumstances.
# In particular, these can't be used as real tags in some cases, including for example when using a format script as a determine in the 'player chats' event.
# | All format scripts MUST have this key!
format: <[name]> says <[text]>
Script Container System
!t playertag.luckperms_primary
Returns a player's primary group.
Depenizen, LuckPerms
LuckPermsGroupTag
think this might be handy for your case?
And this would be for the chat formats is it?
!t <LuckPermsGroupTag.group_prefix>
Returns the group's prefix, if any.
Depenizen, LuckPerms
ElementTag
Yeah you can do a different format for each group
try narrating <player.luckperms_primary_group.group_prefix>
So this is basically to check if the player has that group, if it does, show that chat format
Out of curiosity, what does <player.chat_prefix> return?
This one right?
Sets the entry that is shown in the 'player list' that is shown when pressing tab.
PlayerTag
ElementTag
<PlayerTag.list_name> Returns the name of the player as shown in the player list.
So the working would be:
- Create individual chat formats for each group
- Do a foreach to check the list of groups within luckperms (in a world event, under on player chats) and check if the player has that particular group
- If yes, display the chat format
Will there be a format for each group?
Basically a different prefix and name colour, possibly chat color too for certain groups?
I'm pretty sure you could just name your format scripts rank_format and then when the players chat you define their rank and get the format script for it?
on player chats:
- define rank <player.luckperms_primary_group.group_name>
- determine format:<[rank]>_format```
Depends on how you want to write it really I'd either do that or slap them in a data script
I could give this a try actually
I'll check it out and come back! Thank you so much!
Also, if I was to replace the set group format for luckperms and create one out of Denizen, which is just /setrank {player_name} {rank} {duration} would I have to run asop or something else to execute the luckperms command?
/lp user {name} parent set {rank} I think this is what luckperm's command looks like
Would this also be under the format type?
idk what you mean
that sets the tab name
but it's not persistent (resets after log out)
so i'd set it on join
!e player join
!e player joins
Player
player joins player join
when a player joins the server.
Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.message> returns an ElementTag of the join message.
ElementTag to change the join message.
"NONE" to cancel the join message.
True - this adds switches in:<area> + location_flagged:<flag name>.
Also if you want the ranks to have order on tab (owner first admin below etc.) i think it's sorted by team names alphabetically
so owner gets added to team A, admin to team B etc etc
!c team
player
team (id:<scoreboard>/{main}) [name:<team>] (add:<entry>|...) (remove:<entry>|...) (prefix:<prefix>) (suffix:<suffix>) (option:<type> status:<status>) (color:<color>)
Controls scoreboard teams.
The Team command allows you to control a scoreboard team.
Use the "prefix" or "suffix" arguments to modify a team's playername prefix and suffix.
The "entry" value can be a player's name to affect that player, or an entity's UUID to affect that entity.
You can alternately input a raw PlayerTag or EntityTag, and they will be automatically translated to the name/UUID internally.
Use the "color" argument to set the team color (for glowing, names, etc). Must be from <@link url https://hub.spigotm...
I think you're better off using a data script for both tab and chat
rank_stuff:
type: data
ranks:
owner:
team: A
format_script: owner_format
tab_name: <&a>Owner <&6><player.name> <&7>cool suffix
admin:
team: B
format_script: admin_format
tab_name: <&c>Admin <&6><player.name>
......```
Then just read off it
```yaml
on player joins:
- define rank <player.luckperms_primary_group.group_name>
- define data <script[rank_stuff].parsed_key[ranks.<[rank]>]>
- adjust <player> tab_list_name:<[data.tab_name]>
- team name:<[data.team]> add:<player>
on player chats:
- define rank <player.luckperms_primary_group.group_name>
- define format <script[rank_stuff].data_key[ranks.<[rank]>.format]>
- determine format:<[format]>```
So sorry for the late reply! But thank you so much, I'll try it out today and get back to you!
Hey, is there anyway I could possibly update the tab when the player rank is set? So Danjoe3 has the owner rank, but it hasn't been updated on the tab.
Another question I have is about player tags; is it possible to set those too?
Did you mean to search for listtag.parse_tag?
Player tags? Do you mean the name above the player?
!m nameplate
Did you mean to search for base_plate?
Did you mean to search for command narrate?
!m name_plate
Did you mean to search for base_plate?
Did you mean to search for command narrate?
Changes the name on this player's nameplate.
PlayerTag
ElementTag
<PlayerTag.name> Returns the name of the entity. This can be a player name, an NPC name, a custom_...
About the rank update, I don't think there's a way to explicitly listen to that, you'd have to update it when the player rank is changed depending on how they obtain the rank
yes
when you run any command that changes permissions, ranks, and groups for players, you can just also - inject i_changed_someones_permission_so_now_ill_update_them / run the bit of script you need to run under your "event" - the event is you doing it and you're in control of that, just do the thing in your "event" when you do it-
but if it's another plugin inducing it, you can do many things to figure out when it happens:
- listen to the
commandevent, and execute what you want when that plugin is ran under those conditions;
!event command
Server
This event is to override existing commands, and should not be used to create new commands - use a command script instead.
command <command_name> command
when a player, console, or command block/minecart runs a Bukkit command. This happens before
any code of established commands, allowing scripts to 'override' existing commands.
Note that for the sake of the event line, escaping is used, so 'bukkit:plugins' becomes 'bukkit&coplugins'
when source_type is player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
<context.command> returns the command name as an ElementTag.
<context.raw_args> returns any args used, unmodified as plaintext.
<context.args> returns a ListTag of the arguments.
<context.source_type> returns the source of the command. Can be: PLAYER, SERVER, COMMAND_BLOCK, or COMMAND_MINECART.
<context.command_block_location> returns the command block's location (if the command was run from one).
<context.command_minecart> returns the EntityTag of the command minecart (if the command was run from one).
"FULFILLED" to tell Bukkit the command was handled.
True - this adds switches in:<area> + location_flagged:<flag name>.
- check if any specific events that the plugin listens for as well, and run alongside - eg, if your permissions/rank/groups change when you leave spawn, save the spawn in a noted area and run it then
- if it's totally random, you can check timely events... but that's getting to the point of handling it outside of the plugin if you want both the feature and a light script process
eg, on system time minutely -> did it change?
but i dont recommend that one really, unless it's a very simple script and there's no other way
Oh I see!
I'll try that event then, thats something new!
Regarding the name tag thing
I have this code running to basically remove the . in a players name, as its a bedrock server too
that's specific enough to player joins event
So in a previous thread a friend sent over this code, how could I possibly implement the prefix or so to the nameplate too?
Oh
!mechanism playertag.name
Changes the name on this player's nameplate.
PlayerTag
ElementTag
<PlayerTag.name> Returns the name of the entity. This can be a player name, an NPC name, a custom_...
I'll send over the script, I dont know if I've explained it properly
!search prefix
[Partial Name Match] !Tag objecttag.prefix, !Tag server.group_prefix, !Mechanism playertag.chat_prefix, !Tag playertag.chat_prefix, !Tag elementtag.parse_color, !Tag server.group_prefix.world, !Tag server.scoreboard.team.prefix, !Tag skillapiclasstag.prefix_color, !Tag skillapiclasstag.class_prefix, !Tag luckpermsgrouptag.group_prefix,
[Semi-Decent Match] !Command break, !Command team, !Command drop, !Command if, !Command sql, !Command log, !Command playeffect, !ObjectType secrettag, !Command scoreboard, !Command bungeetag, !ObjectType durationtag, !Language ~waitable, !Command discordreact, !ObjectType locationtag, !Language flag system, !Tag elementtag.not, !Language command syntax, !Tag locationtag.format, !Mechanism playertag.stop_sound, !Tag playertag.display_name, !Tag elementtag.contains_text, !Language advanced object matching,
[Just Barely Matched] !ObjectType elementtag.
Its basically just adjusting the name
https://paste.denizenscript.com/View/115915 This is the thing
Content of Denizen Script Paste #115915: Event... pasted 2023/10/02 06:37:20 UTC-07:00, Paste length: 846 characters across 19 lines, Content: Chat_test: type: world
- adjust <player> name:<[name]>
I'd basically like to add in the prefix or so there or should I just take it from a data script?
You already using the prefix what's the issue
It doesnt seem to show up in the nametag
Its just blank
I mean, just a normal ign
If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!
So I'll understand the issue
Also what
<context.message.replace[<player.name>].with[<[name]>]>
use a format script
!lang format script
Format script containers are very simple script containers used for formatting messages, usually with the 'narrate' command.
Format_Script_Name:
type: format
# The only key is the format. The format can use '<[text]>' as a special def to contain the message being sent.
# '<[name]>' is available as a special def as well for use with the 'on player chats' event to fill the player's name properly.
# Note that 'special' means special: these tags behave a little funny in certain circumstances.
# In particular, these can't be used as real tags in some cases, including for example when using a format script as a determine in the 'player chats' event.
# | All format scripts MUST have this key!
format: <[name]> says <[text]>
Script Container System
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Content of Denizen Script Paste #116010: Rank... pasted 2023/10/03 12:57:45 UTC-07:00, Paste length: 2280 characters across 60 lines, Content: admin_format: type: format
Please record a debug too
Alrighty
also disregard that, I was in the wrong event lol
Content of Server Log Paste #116011: Denizen Debug Logs From NovaPrime Test... pasted 2023/10/03 13:03:02 UTC-07:00, Paste length: 6712 characters across 63 lines, Content: Java Version: 17.0.7Up-time: 3m 38s
Content of Server Log Paste #116011: Denizen Debug Logs From NovaPrime Test... pasted 2023/10/03 13:03:02 UTC-07:00, Paste length: 6712 characters across 63 lines, Content: Java Version: 17.0.7Up-time: 3m 38s
Paper version git-Paper-194 (MC: 1.20.1)-- (Outdated build, behind by 13... Current build is 207)
Denizen: 1.2.8-SNAPSHOT (build 1797-REL) -- (Current build :white_check_mark:)
Depenizen: 2.1.0 (build 845) -- (Current build :white_check_mark:)
@chrome stratus
0 (:triangular_flag_on_post: Hacked or Invalid ID)
17.0.7 :white_check_mark:
ProtocolLib: 5.1.0
Geyser-Spigot: 2.2.0-SNAPSHOT - Bedrock clients are unsupportable. Please do all testing with a Java Edition client.
floodgate: 2.2.2-SNAPSHOT (b75-26c11bd)
ViaVersion: 4.8.0 - Mixed client vs server versions can sometimes cause packet-related issues.
Geyser 😬
!c rename
entity
rename [<name>/cancel] (t:<entity>|...) (per_player) (for:<player>|...) (list_name_only)
Renames the linked NPC or list of entities.
Renames the linked NPC or list of entities.
Functions like the '/npc rename' command.
Can rename a spawned or unspawned NPC to any name up to 256 characters.
Can rename a vanilla entity to any name up to 256 characters, and will automatically make the nameplate visible.
Can rename a player to any name up to 16 characters. This will affect only the player's nameplate.
Optionally specify 'per_player' to reprocess the input tags for each player when renaming a vanilla entity
(meaning, if you us...
Use ^ to rename a players nameplate
!t player.nameplate
Returns the displayed text in the nameplate of the player.
ElementTag
iirc that also changes the players list name, so should check that too
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@chrome stratus
https://paste.denizenscript.com/View/116259
Would this be the correct usage for the rename function?
Content of Denizen Script Paste #116259: Test... pasted 2023/10/09 14:23:18 UTC-07:00, Paste length: 907 characters across 19 lines, Content: Chat_test: type: world
Error Message: The command 'RENAME' is only available when Citizens is on the server.```
This is the error I seem to get, even having Citizen on the server
!logs
Please post your full latest log file.
Background Info: One of the most helpful tools to identifying the source of a problem is your server logs file! Logs contain all sorts of important information like server and plugin versions, any error messages, and a lot more important information (More Info).
How To: Your log can be found in the logs folder within your server folder. The most recent log is a text file labeled latest.log. To get help using these logs, please open that file in a text editor and copy all of the text, then open https://paste.denizenscript.com/New/Log and paste the text into the box on the page. Then click "Submit" and copy the URL and paste that back into this channel.
Please do not upload the file to Discord or to other pastebin services, use the log pastebin linked above.
View the guide page 'Common Mistakes - "Quotes Go Around The Whole Argument"' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#quotes-go-around-the-whole-argument
also also
..?
if the player name starts with . you remove it, else you remove it
oh wait
your whole rename syntax is weird
!c rename
entity
rename [<name>/cancel] (t:<entity>|...) (per_player) (for:<player>|...) (list_name_only)
Renames the linked NPC or list of entities.
Renames the linked NPC or list of entities.
Functions like the '/npc rename' command.
Can rename a spawned or unspawned NPC to any name up to 256 characters.
Can rename a vanilla entity to any name up to 256 characters, and will automatically make the nameplate visible.
Can rename a player to any name up to 16 characters. This will affect only the player's nameplate.
Optionally specify 'per_player' to reprocess the input tags for each player when renaming a vanilla entity
(meaning, if you us...
t arg requires entity not result
also per_player prolly isnt great idea in this case
Optionally specify 'per_player' to reprocess the input tags for each player when renaming a vanilla entity
(meaning, if you use "- rename <player.name> t:<[someent]> per_player", every player will see their own name on that entity).
But when changing a player's name tag, does it really need an entity?
I'll send the log soon!
Wait, Citizen is disabled because of the mc version I believe
I'll send over the log now
Content of Server Log Paste #116265: Denizen Debug Logs From NovaPrime Test... pasted 2023/10/09 23:38:56 UTC-07:00, Paste length: 6511 characters across 62 lines, Content: Java Version: 17.0.7Up-time: 2m 20s
Paper version git-Paper-194 (MC: 1.20.1)-- (:warning: Outdated build, behind by 32... Current build is 226)
Citizens: 2.0.33-SNAPSHOT (build 3219) -- (Current build :white_check_mark:)
Denizen: 1.2.8-SNAPSHOT (build 1797-REL) -- (Current build :white_check_mark:)
Depenizen: 2.1.0 (build 845) -- (Current build :white_check_mark:)
@chrome stratus
0 (:triangular_flag_on_post: Hacked or Invalid ID)
17.0.7 :white_check_mark:
ProtocolLib: 5.1.0
Geyser-Spigot: 2.2.0-SNAPSHOT - Bedrock clients are unsupportable. Please do all testing with a Java Edition client.
floodgate: 2.2.2-SNAPSHOT (b75-26c11bd)
ViaVersion: 4.8.0 - Mixed client vs server versions can sometimes cause packet-related issues.
Paper is a higher-performance alternative to Spigot that is 100% compatible with the equivalent Spigot version. It's much easier to update than Spigot itself, and carries a lot of performance and quality-of-life benefits.
Latest Paper builds are at https://papermc.io/downloads/paper.
(If you would prefer to use a Spigot build, refer to !update spigot).
Damn, updating Paper just messed up with the plugins
I dont know which version to use
Cuz they seem to break all the plugins 😬
Well, some
!update Denizen
Latest Denizen stable release builds are at https://ci.citizensnpcs.co/job/Denizen/. Most users should download the stable release build.
Latest Denizen dev builds are at https://ci.citizensnpcs.co/job/Denizen_Developmental/. Dev builds are for usually for test servers only.
Spigot resource page for Denizen is at https://www.spigotmc.org/resources/denizen.21039/ (do NOT download builds from Spigot).
!update Depenizen
Latest Depenizen dev builds are at https://ci.citizensnpcs.co/job/Depenizen/.
!update citizens
Latest Citizens dev builds are at https://ci.citizensnpcs.co/job/Citizens2/.
Spigot releases of Citizens are available at https://www.spigotmc.org/resources/citizens.13811/.
Strange, I have all the latest versions and yet they crash
https://paste.denizenscript.com/View/116266 This is the error I seem to get. I cant do a debug or so 😬
Content of Denizen Script Paste #116266: Error... pasted 2023/10/10 01:22:31 UTC-07:00, Paste length: 3000 characters across 28 lines, Content: [12:20:57 INFO]: [Denizen] Enabling Denizen v1.2.8-SNAPSHOT (build 1797-REL)[12:20:57 INFO]: +> [...
So please let me know
thaaats interesting
I dont know, it's really strange. That's the latest paper version too
could you post latest logs?
Alright, let me try that quickly
The paste above was the latest one
Denizen didnt load in
buuuut thats not whole thing
Do you want me to paste in the entire console start up?
the latest.log file, yes
Oh right
I'm just starting the server with the Denizen dev build
Oh wait
The latest dev build worked
That seemed to somewhat load in the plugins
Now to get the name tag to show up
Well the name tag doesnt seem to work on players
There isnt any errors
That looks like a bedrock player, ideally test with a normal Java one (as we don't really know how Geyser might handle stuff differently)
But also what people usually do to change player nameplates is hide their real ones and use something like a text display, as iirc Mojang has a length limit on player names for some reason
I'll try and test it out, but would the format for the rename function be correct? It still shows that the entity name is wrong
Content of Denizen Script Paste #116358: New... pasted 2023/10/12 07:39:40 UTC-07:00, Paste length: 894 characters across 18 lines, Content: Chat_test: type: world
How would one do that?
Look at the meta
!c rename usage
entity
rename [<name>/cancel] (t:<entity>|...) (per_player) (for:<player>|...) (list_name_only)
Renames the linked NPC or list of entities.
- rename Bob
- rename Bob t:<[some_npc]>
- rename <green><player.name> t:<[some_entity]> per_player
- wait 10s
- rename cancel t:<[some_entity]> per_player
It even has examples ^, t: is the entities to rename, and <name> is the name to rename to
Used to be more complex, but with display entities it should be as simple as hiding the player name, and mounting a text display with the proper name to them
!m translation
(Property) A display entity's translation, represented as a !objecttype LocationTag vector.
Can be interpolated, see !language Display entity interpolation.
Properties
EntityTag
LocationTag
<EntityTag.translation> (Property) A display entity's translation, represented as a <@link objectt...
And that to put it at the correct height