# WeaponSwing

Example usage:

```lua
Events.WeaponSwing(function(event)
    if (event.weapon == ItemType.LASER_SWORD) then
        ItemService.dropItem(ItemType.COSMIC_LUCKY_BLOCK, event.player:getEntity():getPosition())
    end
end)
```

### Parameters

#### player: [Player](https://docs.easy.gg/scripting/bedwars-scripting/objects/player)

The player that is swinging the weapon.

#### weapon: [ItemType](https://docs.easy.gg/scripting/bedwars-scripting/types/itemtype)

The ItemType of the weapon being swung.

#### hitEntity: [Entity](https://docs.easy.gg/scripting/bedwars-scripting/objects/entity) | nil

The entity that was hit by the sword swing (may not exist if the swing missed).

#### cancelled: bool <mark style="color:yellow;">\[modifiable]</mark>

If set to true, the weapon swing will be cancelled.
