#About conditions

1 messages · Page 1 of 1 (latest)

delicate junco
#

Hello,

I'm trying to set up DeluxeMenus to display different items based on player permissions, but the conditions are not working as expected.

DeluxeMenus version: 1.14.1

Minecraft version: 1.21.6

Vault and LuckPerms are installed (Vault is the latest version)

My conditions are set as follows (excerpt):
conditions:
  test_unlocked:
    type: has_permission
    permission: test
  test_locked:
    type: has_permission
    permission: test
    negate: true

items:
  test_locked:
    condition:
      - test_locked
    material: yellow_stained_glass_pane
    display_name: "Not acquired"
    slot: 1

  test_unlocked:
    condition:
      - test_unlocked
    material: stonecutter
    display_name: "Acquired"
    slot: 0

Even though I set the permission correctly in LuckPerms, both the locked and unlocked items are displayed simultaneously, regardless of whether the player has the permission or not.

Vault and LuckPerms appear to be working fine, but the permission check in DeluxeMenus is not functioning properly.

I also tried conditions using tag:test and not_tag:test, but those didn't work correctly either.

Could you please help me identify possible causes or configuration mistakes that I might have overlooked?
Thank you in advance.

river moat
#

The section conditions: doesn't exist. You need to set a requirement under your item, like a view_requirement:

items:
  test_locked:
    material: yellow_stained_glass_pane
    display_name: "Not acquired"
    slot: 1
    view_requirement:
      requirements:
        test_locked:
          type: has permission
          permission: test

If you want to invert the permission check, you can do: ```yml
type: "!has permission"
permission: your.permission

https://wiki.helpch.at/helpchat-plugins/deluxemenus/options-and-configurations/requirements

The wiki has examples of menus you can use as templates: https://wiki.helpch.at/helpchat-plugins/deluxemenus/example-gui-menus
delicate junco
#

Hi again, and thank you once more for your previous help!

I tested the following simple menu setup using view_requirement, but I ran into a confusing issue:

menu_title: 'Test'
open_command:
 - test 
open_commands:
 - '[message] &6open test menu...'
size: 9

items:
  test_locked:
    material: yellow_stained_glass_pane
    display_name: 'Not acquired'
    slot: 0
    view_requirement:
      requirements:
        has_test:
          type: '!has permission'
          permission: 'test'

  test_unlocked:
    material: black_stained_glass_pane
    display_name: 'Acquired'
    slot: 1
    view_requirement:
      requirements:
        has_test:
          type: 'has permission'
          permission: 'test'

The issue:

Even without the test permission, the item with has permission is still being shown.
On the other hand, the item with !has permission does not appear — which seems to indicate something is not working as intended, possibly a misconfiguration.

I've verified that:

The permission `test` is not granted to the player (via LuckPerms).

Vault is installed and working properly.

DeluxeMenus loads without errors on startup.

Could there be something wrong with my configuration?
Or is there any initial setup/environment I might be missing?

Any insight would be greatly appreciated. Thank you again for your time and support! 😊

river moat
#

I tried what you shared, that only happens to me if I am OP. Can you make sure you /deop yourself and see if it still happens?

#

Screenshots, first without OP, and second with OP 🤔

#

Without OP, test permission true:

delicate junco
#

I was able to get it working after using /deop — I’m very sorry for the confusion!
I didn’t realize that being OP gives all permissions by default. That was a beginner’s mistake on my part😇

#

Now, I have one more question:

I’m trying to show two items in the same slot: 0, and switch between them depending on whether the player has a specific permission.
However, only one of them appears — it looks like there’s a problem where the other item does not show up at all, even though it should. It seems the item defined later in the file overrides the one before.

When I set them to slot: 0 and slot: 1, both are displayed correctly based on the permission, but I want only one item in slot 0 to appear depending on permission.

How should I structure the configuration so that only one of the items shows up in slot: 0 based on the player's permission?

#

-- have not permission in slot:0: ✅

#

-- have permission in slot:0: ❌(Not opened test menu)

river moat
#

No worries 😅

Since you already have your view requirements set up properly, you don't need to do much to accomplish what you'd like. You just need to use priorities: https://wiki.helpch.at/helpchat-plugins/deluxemenus/options-and-configurations/item#priority

The smaller the number, the higher the priority (0 being the highest priority):

items:
  test_locked:
    material: yellow_stained_glass_pane
    display_name: 'Not acquired'
    slot: 0
    priority: 0
    view_requirement:
      requirements:
        has_test:
          type: '!has permission'
          permission: 'test'

  test_unlocked:
    material: black_stained_glass_pane
    display_name: 'Acquired'
    slot: 0
    priority: 1
    view_requirement:
      requirements:
        has_test:
          type: 'has permission'
          permission: 'test'

Since we want to show locked first, we use a higher priority (lower number) priority: 0 and both in slot: 0

Without the test permission and with:

delicate junco
#

Thank you so much! Everything is now working perfectly 🙌

Your explanation about priority was exactly what I needed — I didn't realize items in the same slot needed priority to control visibility.

#

I really appreciate your clear guidance and quick responses. You saved me a lot of time. Thanks again!