Guns

guns.yml

This is the file where all custom guns behaviour and config are stored

Example gun

1
revolver_gun:
2
enabled: true
3
permission: revolver_gun
4
model_id: 1
5
vanilla_type: GOLDEN_SWORD
6
name: '&fRevolver'
7
specific_properties:
8
projectile: projectile
9
events:
10
gun_shot:
11
play_sound: revolver_shot
12
play_effect: SMOKE
13
gun_no_ammo:
14
play_sound: revolver_no_ammo
15
craft_recipe:
16
enabled: true
17
pattern:
18
- III
19
- ISX
20
- WXX
21
ingredients:
22
I: IRON_INGOT
23
S: STICK
24
W: SPRUCE_PLANKS
Copied!

Specific properties

1
specific_properties:
2
projectile: projectile
Copied!
Guns have a specific property which identifies the compatible projectile. To use guns you must hold the specified custom item in left hand while shoting with gun.
You can create projectiles in items.yml file, it contains generic items which has no particular functionality in the game (ingredients for recipes and some little objects)

Events

1
events:
2
gun_shot: #event called when user shots
3
play_sound: revolver_shot #play a sound (vanilla or custom)
4
play_effect: SMOKE #play an effect
5
gun_no_ammo: #event called when user has no projectiles left
6
play_sound: revolver_no_ammo #play a sound (vanilla or custom)
Copied!