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:
The player that is swinging the weapon.
weapon:
The ItemType of the weapon being swung.
hitEntity: | nil
The entity that was hit by the sword swing (may not exist if the swing missed).
cancelled: bool [modifiable]
If set to true, the weapon swing will be cancelled.