Repository navigation
Melee System
The Melee System allows content pack creators to add melee attacks to weapons in Vic's Point Blank.
Players can perform melee attacks using the V key while holding a weapon that supports the feature.
The system supports customizable melee animations, damage, attack reach, cooldowns, and animation timing, allowing creators to implement different melee attacks for their weapons.
- Custom Animations: Define melee animations for individual weapons.
- Random Animation Selection: Configure multiple melee animations that can be selected randomly.
- Customizable Damage: Set the damage dealt by melee attacks.
- Configurable Reach: Adjust the distance at which melee attacks can hit targets.
- Cooldown System: Prevent players from repeatedly triggering melee attacks without waiting.
- Animation Timing: Configure animation duration and pre-melee timing.
- Configurable Entity Damage: Control whether cats and ocelots can be damaged by melee attacks.
This one goes inside the "features" section array of your weapon.json file
{
"type": "Melee",
"enabled": true,
"damage": 8.0,
"cooldown": 20,
"reach": 3.0,
"damageCatsandOcalotsEntities" : true,
"meleeAnimations": [
{
"name": "animation.model.melee_1",
"duration": 700,
"preMelee": 200
},
{
"name": "animation.model.melee_2",
"duration": 870,
"preMelee": 220
},
{
"name": "animation.model.melee_3",
"duration": 850,
"preMelee": 220
}
]
},Note: This example illustrates the configuration structure. Verify the field names and nesting against your actual weapon JSON format before using it.
| Property | Type | Description |
|---|---|---|
enabled |
Boolean | Enables or disables the melee system for the weapon. |
damage |
Number | Sets the damage dealt by melee attacks. |
cooldown |
Integer | Sets the cooldown between melee attacks, in ticks. |
reach |
Number | Sets the maximum melee attack reach. |
damageCatsandOcalotsEntities |
Boolean | Controls whether cats and ocelots can be damaged by melee attacks. |
meleeAnimations |
Array | Defines the melee animations available to the weapon. |
Each entry in meleeAnimations defines an animation that can be selected for a melee attack.
| Property | Type | Description |
|---|---|---|
name |
String | The name of the melee animation. |
duration |
Integer | Configures the animation duration in ticks. |
preMelee |
Integer | Configures the timing before the melee attack takes effect. |
- Configure the melee system in the weapon's JSON file.
- Set
enabledtotrue. - Define the damage, reach, cooldown, and melee animations.
- Equip the weapon in-game.
- Press V to perform a melee attack.
If multiple melee animations are configured, the system can randomly select an animation for the attack.
Melee attacks cannot be triggered while the player is:
- Aiming.
- Sprinting.
- Reloading.
- Inspecting the weapon.
- Shooting or firing.
- Drawing or equipping a weapon.
- Holstering or hiding a weapon.
Melee attacks are available when the player is idle or walking, provided the weapon is configured correctly and the cooldown has expired.
Check the following:
- Ensure
"enabled": trueis set in the melee configuration. - Verify that the weapon's JSON configuration is valid.
- Confirm that the melee animation names match the animations available for the weapon.
- Make sure the player is not performing an action that prevents melee attacks.
- Ensure the melee cooldown has expired before attempting another attack.
Verify that the animation names are correct and that the corresponding animations are available in the weapon's animation setup.
- Melee settings can be customized for individual weapons.
- Multiple animations can be configured for randomized melee attacks.
- Melee attacks respect the system's cooldown and action restrictions.