Solved block equipping offhand from 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 community!

    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.

Kush

Member
Jan 29, 2017
29
2
3
I'm trying to cancel the event where a player equips an offhand item in their inventory. I got it to work with the hotkey control, but this is simply bypassed by opening your inventory and placing the item in the slot. Anyway to cancel that event?

Here's the code I used to cancel the control:
Code:
on off hand switch:
    cancel event
[doublepost=1593797030,1593796228][/doublepost]Solved, I figured this out by doing:
Code:
on any movement:
    if "%off hand item%" does not contain "air":
        add off hand item to player's inventory
        set off hand item to air

just a little tip, %off hand item% returns as "0 air", so make sure if you use "is" you replace "air" to "0 air" for whatever your item is.
 
Status
Not open for further replies.