I’m working on a menu that displays items based on players from the online list who meet a specific LuckPerms group condition. I want to show the item if any online player from the list meets the conditions of {target}.
Key Requirements:
Show Items Based on Group Conditions: I want to display the item for any player from the online player list who meets the condition of being in the {target} group (e.g., %luckperms_in_group_{target}%).
Dynamic Display: For each slot, I want the item to show if the player in that slot (from the online player list) meets the required LuckPerms group condition.
Slot-Filling Logic: If player 1 meets the condition, the item is shown in slot 10. If player 2 meets the condition, the item is shown in slot 11. If player 3 does not meet the condition, slot 12 will show the next player that meets the condition. The slots should automatically be filled by the next matching player, avoiding gaps.
No Need for View Requirements for Player Opening the Menu: The view requirement should not depend on the player opening the menu but instead on the online players in the player list who meet the condition.
Using playerlist_* placeholders: For each player in the player list, I can use %playerlist_online-menu_0%, %playerlist_online-menu_1%, etc. to get the players, but I need to filter based on whether they belong to {target}.
menu_title: '&8&l&nManage {target}'
open_command: mykingdom
args:
- target
register_command: true
size: 54
args_usage_message: "test"
open_requirement:
requirements:
permissions:
type: 'equals'
input: '%luckperms_first_group_on_tracks_royal%' # Check if the player’s first group on the track is 'yes'
output: 'yes' # Only show the item if the placeholder outputs 'yes'
deny_commands:
- '[message] &cAlleen een koning of koningin kan dit kommando uitvoeren!'
player0:
slot: 10
material: book
display_name: '&7Manage &f%playerlist_online-menu_0%' # Show the first online player
lore:
- ''
- '&7Click for options'
- ''
click_commands:
- '[player]mykingdom %playerlist_online-menu_0%'
# This item will only be visible if the player in the player list slot meets the {target} condition.
view_requirement:
requirements:
luckperms_in_group_{target}:
type: 'equals'
input: '%luckperms_in_group_{target}_playerlist_online-menu_0%' # Check if the player in slot 0 meets the target group
output: 'yes'
'filler_glass2':
material: black_stained_glass_pane
priority: 100
display_name: ' '
slots:
- 1-53
'filler_glass':
material: white_stained_glass_pane
priority: 99
display_name: ' '
slots:
- 10-16
- 19-25
- 28-34
- 37-43
What I Want to Achieve:
Automatic Player Filtering: I want the items in the menu to be dynamically displayed based on the players who are online and meet the {target} group condition. For example:
Slot 10: The first player who meets the group condition.
Slot 11: The second player who meets the group condition.
Slot 12: The next available player who meets the condition.
Dynamic Slot Filling: I want the item slots to be filled without gaps for players who meet the condition. If a player doesn’t meet the condition, that slot should stay empty, and the next available player who meets the condition should be filled in that slot.
Group Check for Each Player: For each item slot, I want to check if the player in that slot (from %playerlist_online-menu_0%, %playerlist_online-menu_1%, etc.) meets the group condition specified by {target}. If they do, show the item in that slot.
Could you guide me on how to implement this logic for filtering players based on their LuckPerms group in a menu, and showing the items only for those who match the conditions?