Solved How do I a certain type of tool in a player's inventory?

  • 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.

Nightomatic

New Member
May 24, 2021
5
0
1
23
Hi, I'm trying to make it so that every tick, any sword/axe in a player's inventory is enchanted with Sharpness 5.
At first, I made it run the enchant command on the player for sharpness 5, but I've noticed that only enchant's the tool in the player's hand. Any idea on how to fix this?

Here's the script:

every tick:
loop all players:
if {role::%loop-player%} is equal to "warrior":
execute command "/enchant %loop-player% sharpness 5"
 
Hi, I'm trying to make it so that every tick, any sword/axe in a player's inventory is enchanted with Sharpness 5.
At first, I made it run the enchant command on the player for sharpness 5, but I've noticed that only enchant's the tool in the player's hand. Any idea on how to fix this?

Here's the script:

every tick:
loop all players:
if {role::%loop-player%} is equal to "warrior":
execute command "/enchant %loop-player% sharpness 5"
While I don't know how to fix that, the /enchant command enchants the thing in your HAND. You'd have to use the effect.
I'm assuming you'd loop the inventory and check if it = a diamond, wood, stone iron, or gold axe. (or netherite if you're like that lol)
 
Status
Not open for further replies.