Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasConflictingEnchant is missing in Skript #4245

Open
1 task done
Darkweasam opened this issue Aug 4, 2021 · 3 comments
Open
1 task done

hasConflictingEnchant is missing in Skript #4245

Darkweasam opened this issue Aug 4, 2021 · 3 comments
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).

Comments

@Darkweasam
Copy link

Darkweasam commented Aug 4, 2021

Suggestion

Hello,
I do not seem to find this expression/condition in Skript at all, meaning I cannot check for mutually-exclusive enchantments on an item before adding a new vanilla enchantment to it

https://papermc.io/javadocs/paper/1.16/org/bukkit/inventory/meta/ItemMeta.html#hasConflictingEnchant(org.bukkit.enchantments.Enchantment)

hasConflictingEnchant
boolean hasConflictingEnchant​(@NotNull
@NotNull Enchantment ench)
Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.

Parameters:
ench - enchantment to test
Returns:
true if the enchantment conflicts, false otherwise

Why?

I would like to add Sharpness 6 and other unobtainable vanilla enchantments through anvil and I don't seem to find a better way than this:

on anvil prepare:
    if slot 0 of event-inventory is an enchanted book:
        set {_bookslot} to 0
        set {_itemslot} to slot 1 of event-inventory
    else if slot 1 of event-inventory is an enchanted book:
        set {_bookslot} to 1
        set {_itemslot} to slot 0 of event-inventory
    else:
        stop
    if stored enchants of slot {_bookslot} of event-inventory contains sharpness 6:
        set {_i} to {_itemslot}
        enchant {_i} with sharpness 6
        set event-slot to {_i} 

However with such skript, I am able to add sharpness6 to a sword that already has Smite for example (because I cannot find a way to check for conflicting enchants this way without adding ALL checks manually into my skript)

In short, I would like to be able higher levels of enchanted books for my swords/armors yet keep the original vanilla mutually-exclusive enchantments rule of Minecraft

Other

No response

Agreement

  • I have read the guidelines above and confirm I am following them with this suggestion.
@Th-Underscore
Copy link

Th-Underscore commented Aug 4, 2021

I don't see how this is an issue... if you want a feature, then you need to give more details. If you need help, join the skUnity Discord server and ask there.

@HW2955
Copy link

HW2955 commented Aug 4, 2021

Then there wouldn't be suggestion form. Let's begin with skript-reflect - if vanilla skript or addons don't provide something BUT bukkit api does, then skript-reflect is your best friend and that's it.
It would be a nice touch, but not many people would even know and actually use it.
In short; completely pointless.

@TPGamesNL
Copy link
Member

Good suggestion 👍

@TPGamesNL TPGamesNL added enhancement Feature request, an issue about something that could be improved, or a PR improving something. good first issue An issue that would be good for a first-time contributor to make a PR for priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements). labels Aug 5, 2021
AyhamAl-Ali added a commit to AyhamAl-Ali/Skript that referenced this issue Oct 16, 2021
@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Oct 16, 2021
@TheLimeGlass TheLimeGlass removed the good first issue An issue that would be good for a first-time contributor to make a PR for label Dec 16, 2022
@sovdeeth sovdeeth removed the PR available Issues which have a yet-to-be merged PR resolving it label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: lowest "Nice to have" updates that are not required (tiny low impact bug fixes or QoL enhancements).
Projects
None yet
Development

No branches or pull requests

6 participants