Plugin category: Random Minecraft version: 1.21.4+ Suggested name: PermissionEquip What I want: I’d like a plugin where equipping armor, elytra, or any item for the armor slots requires permission. If a player lacks the necessary permission, they shouldn’t be able to equip the item. Whether through their inventory, dispensers, or any other method. Additionally, the plugin should support customizable messages with hex color support, allowing each item to have its own unique message when a player tries to equip it without the required permission. This is how config should look like Code: items: diamond_helmet: permission: "armor.diamondhelmet" deny_message: "&cYou do not have permission to equip a &bDiamond Helmet&c!" elytra: permission: "equip.elytra" deny_message: "&cYou do not have permission to equip an &bElytra&c!" netherite_chestplate: permission: "armor.netheritechestplate" deny_message: "&cYou do not have permission to equip a &bNetherite Chestplate&c!" # Add more items as needed # Use hex colors in messages with the syntax &#RRGGBB (if supported) gold_boots: permission: "armor.goldboots" deny_message: "&#FFD700You cannot equip Gold Boots!" Ideas for commands: /Permissionequip reload Ideas for permissions: PermissionEquip.reload When I'd like it by: As soon as possible please
I am starting on this now. With it being Monday morning, give me until the weekend and I should have it done for you.
Great thanks EDIT: btw if items are not listed in the config then player should not require any permission to equip those item
https://github.com/bukkit-requests/PermissionEquip/releases/tag/1.0 Should be able to grab it from the link above. I didn't test all of the items, but as long as you match the item listed under "Permissions" in the README.md file in config.yml, you should be able to restrict that specified item. Let me know if this works or you run into any bugs.
Hey Thank you for the plugin but I found some bugs: - I can right click the armor to equip it - For some reason I can't break/use/rightclick anything can you please make it like this?? items: diamond_helmet: permission: "armor.diamondhelmet" deny_message: "&cYou do not have permission to equip a &bDiamond Helmet&c!" elytra: permission: "equip.elytra" deny_message: "&cYou do not have permission to equip an &bElytra&c!" netherite_chestplate: permission: "armor.netheritechestplate" deny_message: "&cYou do not have permission to equip a &bNetherite Chestplate&c!" so I can customize permissions for each item (if possible)
Yup! I forgot about right-clicking. I can get that fixed and look into being unable to break things. I didn't have that issue on my end. What about the permissions do you want to customize?
The only thing that can change is the permission node itself. If you change that then it breaks code within the plugin. I will work on the bugs but the permissions aren't going to change.
https://github.com/bukkit-requests/PermissionEquip/releases/tag/1.0.1 I have fixed the right-click issue. For breaking items, I only had this plugin in my plugins folder and I was able to delete blocks and such. What plugins do you have listed?
oh nvm about the breaking blocks and stuff. Turns out I had world spawn protection really high. but more bugs: - You can hotkey armor in the armor slots - dispensers can equip armor
https://github.com/bukkit-requests/PermissionEquip/releases/tag/1.0.2 Please give that a try. Also, how are you using that dispenser? I've tested it with a pressure plate and lever, and it doesn't put the armor on me.
here are all the bugs: - when right clicking armor while looking at a block it equips it (if looking at air then it works fine) - dispensers still works - while holding armor and spam clicking on your armor slot sometimes it equips it - hotkeys still works
https://github.com/bukkit-requests/PermissionEquip/releases/tag/1.0.3 Give the link above a shot. I was able to fix everything but the spam-clicking one. After looking into that, it only happens when you're moving your cursor around the armor slot and clicking. I tried to find an even to detect cursor movement, but I couldn't get far. I would consider that a bug. If you happen to find out how I can stop that, I would love to add that to the code for you.
maybe if someone try's to click the armor on. it takes it off their cursor and puts it in inventory (drops it if inventory is full) or it just closes their inventory. EDIT: If someone still able to equip the armor. maybe adding like every second or something it checks if player have anything equipped without permission then it puts it in inventory (drops it if inventory is full) Also is it possible to add a cooldown on spam clicking armor on?
Sounds to me like you're only checking the InventoryClickEvent. You also need to cancel the InventoryDragEvent, which occurs when moving the cursor while the cursor button is held. It can happen by accident at times when spam-clicking.
Even after adding the InventoryDragEvent this doesn't stop the player from moving the cursor around the armor slot and getting the armor to be placed.
If you'd like, I can make it so the player can't move the item at all in their inventory but can move it anywhere within something like a chest?
That won’t be good. But just make it if they don’t have permission for equip something and then click on the armor slot with that item it closes their inventory and also checks if player have that item equipped then gives it back or drops it
v1.0.4 This should include your latest request. I was still able to replicate it, but I wasn't able to do it as often.
Also please add if a player attempts to equip armor without the required permission, the item should either be dropped on the ground or returned to their inventory if there is available space. So this should hopefully resolve the issue.
That's because you are moving your cursor at the same time as placing the armor in the armor slot. As I stated before, there isn't a way for me to detect that (that I know of) and consider that a bug.
Can't you check if armor slot has changed? I just made this in skript plugin which works great Code: on inventory click: if clicked slot is 38: if cursor slot of player is netherite chestplate: if player don't have permission "netherite.chestplate": cancel event close player's inventory send "&cYou don't have permission to equip this armor" EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Right, I have this in the code as well. However, if you're actively moving the mouse around an armor slot and clicking in that armor slot at the same time, the armor will be placed. That is what I can't fix. Everything you listed before works as intended.
Oh okay, but can you make it so when a player's inventory closes, it checks if they have any armor equipped that they’re not supposed to? If they do, it should drop or go back to their inventory if there’s space. If this is already added, it's not working. Edit: also there use to be a skript plugin's addon (Abandoned now) which did the same thing and it never had that issue he's the code if you want to take a look at it https://github.com/Sharpjaws/SharpS...forcookies/armorequip/ArmorEquipListener.java
when someone equips the armor and instead of closing inventory if they get kicked or something and then join back the armor is still equipped EDIT: also it's not letting me equip any thing with right click even if its not in the config
v1.0.6 I added a quit/kick event so when they leave or quit, it will take the restricted armor off and when they come back in game, it should be in their inventory or dropped. You should be able to right-click armor not in the config now.