Holding Crossbow Animation

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

squib

Member
Aug 26, 2025
2
0
1
Hi,

So basically, I'm trying to make a gun script. I want it so that when a player is holding a certain item (which is a firearm), they will hold it like they would with a crossbow. I've never done something like this before, so I have no idea where to start. But I don't wanna be spoon fed, I wanna be taken through the whole process and learn something from it. There's a few other related questions I have for this, but I believe it'd be more convenient if they're answered one at a time:

- Is it possible to play the holding loaded crossbow animation when a player holds a certain item that isn't a crossbow? If so how? Or would I have to use an actual crossbow item?
- Is it possible to cancel the player punch animation upon left clicking?
- Once the whole holding loaded crossbow thing is figured out, how would I play the reloading animation?

The addons I have are SharpSK, SkBee, SkQuery, and SkStuff.

Please respond soon because I have a limited time to get this done. Thank you.
 
Code:
command /gun:
    trigger:
        set {gun} to a crossbow named "&cAssault Rifle"
        set nbt of {gun} to "{Unbreakable:1b}"
        give {gun} to player

on left click holding a crossbow:
    if player's tool is a crossbow named "&cAssault Rifle":
        cancel event
        play sound "minecraft:item.crossbow.loading_end" at player
        if "Charged" of nbt of player's tool is true:
Something like this no?