Solved Random level enchant

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Logan8601

Member
Apr 2, 2021
3
0
1
23
Skript Version (do not put latest): 2.5.3-nightly
Skript Author: Logan8601
Minecraft Version: 1.16.5

I'm trying to make a command that when you do it enchants your held item with sharpness that is a random level.

Full code:
Code:
command /Renchant:
  Trigger:
    enchant the player's held item with sharpness random integer between 1 and 100

errors on reload:
Code:
Can't understand this condition/effect: command /Renchant:
  Trigger:
    enchant the player's held item with sharpness random integer between 1 and 100

Addons:
Skellet 1.9.11
skript-yaml 1.3.2
MongoSK 2.0.1
skutililitys 0.9.2
SkRayFall 1.9.23
Vixio 2.0.7
skquery 4.1.4
skscraft 1.4
Tuske 1.8.2-pikachu-patch-3
Skematic 2.2b

Troubleshooting:


Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it? I tried assigning the random number to a variable then base the sharpness level off that
 
Code:
command /reenchant:
    trigger:
        enchant the player's held item with "sharpness %random integer between 1 and 100%" parsed as enchantment type
 
It works great for enchanting an item that is already in inventory but how can I make it so I can just give an item to a player with a random level. If you would like can you also tell me how to do that with multiple enchants on the same item?

Code:
give player bow of "infinity %random integer between 0 and 1%" parsed as enchantment type
 
It works great for enchanting an item that is already in inventory but how can I make it so I can just give an item to a player with a random level. If you would like can you also tell me how to do that with multiple enchants on the same item?

Code:
give player bow of "infinity %random integer between 0 and 1%" parsed as enchantment type
Set a variable to the bow then enchant the variable then give the player the variable
 
Status
Not open for further replies.