Zrips / CMI

116 stars 97 forks source link

Hat blocking hat items & enchanted don't work #8589

Open bobhenl opened 6 months ago

bobhenl commented 6 months ago

Description of Issue

Hello, from thie hat block seciton only itemlore option works, others seem to don't work:


      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true

Give yourselves diamond sword, enchant it (give & enchant command), and then try to put it on the head, and you can, even when it should be blocked due to enchant and because it's not hat type item

So both of these don't work and I don't have any bypass permission

Version Information

[19:41:25 INFO]: --------------------------------------------------
[19:41:25 INFO]: CMI: 9.7.0.2 Unknown  SqLite
[19:41:25 INFO]: CMILib: 1.4.6.1 
[19:41:25 INFO]: Server: Purpur(2159) 1.20.4-R0.1-SNAPSHOT-
[19:41:25 INFO]: CMI economy: Enabled Vault: 1.7.3-CMI CMI Chat: Disabled 
[19:41:25 INFO]: Modules -> 46 enabled 13 disabled: customMessages, mirror, tablist, playerChatTag, deathMessages, disabledEnchants, chatBubble, ranks, firstJoinMessages, playerCombat, votifier, sitAnimation, namePlates
[19:41:25 INFO]: --------------------------------------------------

Errors

No response

Relevant Config Sections

Hat:
    Block:
      # When enabled we will not allow to place items into head slot if item has custom lore
      # Doesn't apply to helmet items
      WithLore: true
      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true

Relevant Plugins

No response

Agreements

Zrips commented 6 months ago

By any chance player has access to cmi.inventoryhat.bypass permission node? You can double check permission access with /cmi haspermission cmi.inventoryhat.bypass Zhax just incase player inherited bypass permission node from somewhere else

bobhenl commented 6 months ago

image Doesn't have permission, also it's not tab completing the names btw image image

Zrips commented 6 months ago

What is the remaining config for hat command?

  Hat:
    Block:
      # When enabled we will not allow to place items into head slot if item has custom lore
      # Doesn't apply to helmet items
      WithLore: true
      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true
    Allow:
      # When enabled we will allow player to put on mob head without cmi.inventoryhat permission node
      # When disabled player will need to have cmi.inventoryhat to put on mob heads as hats
      MobHeads: true
    # List of materials to be allowed on players head
    WhiteList:
    - bedrock

This is the full one. By any chance you have something weird set for whitelist?

bobhenl commented 6 months ago

I have only this:

  Hat:
    Block:
      # When enabled we will not allow to place items into head slot if item has custom lore
      # Doesn't apply to helmet items
      WithLore: true
      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true
    Allow:
      # When enabled we will allow player to put on mob head without cmi.inventoryhat permission node
      # When disabled player will need to have cmi.inventoryhat to put on mob heads as hats
      MobHeads: true
    # List of materials to be allowed on players head
    WhiteList:
    - bedrock
Zrips commented 6 months ago

So weird, tested it with multiple variations on a clean server, player had no ability to place items on his head without permission and with that setup. Can you test this with CMI only just to be sure that its not another plugin which interferes?

bobhenl commented 6 months ago

@Zrips I've tested with only these plugins:

And it's still happening, even when I gave myself only cmi.command.hat and I have these settings there:

  Hat:
    Block:
      # When enabled we will not allow to place items into head slot if item has custom lore
      # Doesn't apply to helmet items
      WithLore: false
      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true
    Allow:
      # When enabled we will allow player to put on mob head without cmi.inventoryhat permission node
      # When disabled player will need to have cmi.inventoryhat to put on mob heads as hats
      MobHeads: true
    # List of materials to be allowed on players head
    WhiteList:
    - bedrock

I tried even reset to the default configuration but it didn¨t work. Btw using the newest Purpur (1.20.4), not sure if it can affect it somehow

Edit: I tried to reset luckperms too & it happens on fresh luckperms with only cmi.command.hat

polang233 commented 1 week ago

@Zrips I've tested with only these plugins:

  • CMI, CMILib, LuckPerms, PlaceholderAPI, spark, Vault

And it's still happening, even when I gave myself only cmi.command.hat and I have these settings there:

  Hat:
    Block:
      # When enabled we will not allow to place items into head slot if item has custom lore
      # Doesn't apply to helmet items
      WithLore: false
      # When enable we wont allow to equip items which are not hat type
      NoneHatItems: true
      # When enable we wont allow to equip none hat items with enchant on it
      NoneHatEnchanted: true
    Allow:
      # When enabled we will allow player to put on mob head without cmi.inventoryhat permission node
      # When disabled player will need to have cmi.inventoryhat to put on mob heads as hats
      MobHeads: true
    # List of materials to be allowed on players head
    WhiteList:
    - bedrock

I tried even reset to the default configuration but it didn¨t work. Btw using the newest Purpur (1.20.4), not sure if it can affect it somehow

Edit: I tried to reset luckperms too & it happens on fresh luckperms with only cmi.command.hat

22:26:27 INFO: CMI版本:9.7.6.4 MySQL

22:26:27 INFO: 服务器版本:Paper(1620) 1.12.2-R0.1-SNAPSHOT-

22:26:27 INFO: 模块 -> 49 已启用 17 已禁用:spawnerProximity, mirror, tablist, elytraExploit, skin, anvilRenameColor, spawners, dynamicSigns, eventCommands, playerChatTag, schedule, chatBubble, ranks, votifier, spawnerCharge, homeInteractions, totemBehavior

In the latest version, the problem still persists. The default setting is true, but my actual testing did not prevent players from using the/hat command to place the diamond sword and enchanted items on their heads. Additionally, the whitelist is also invalid, only the option WithLore is valid

polang233 commented 1 week ago

@Zrips