Info

Basic info about your weapon visual appearance

The Info: module is required for all weapons

  Info:
    Weapon_Item: <Item Serializer>
    Weapon_Info_Display: # scroll down for more information
    Dual_Wield: # scroll down for more information
    Weapon_Converter_Check:
      Type: <true/false>
      Name: <true/false>
      Lore: <true/false>
      Enchants: <true/false>
      Custom_Model_Data: <true/false>
    Weapon_Get_Mechanics: <Mechanics>
    Weapon_Equip_Mechanics: <Mechanics>
    Weapon_Equip_Delay: <ticks>
    Weapon_Holster_Mechanics: <Mechanics>
    Cancel:
      Block_Interactions: <true/false>
      Item_Interactions: <true/false>
      Break_Blocks: <true/false>
      Drop_Item: <true/false>
      Swap_Hands: <true/false>
      Arm_Swing_Animation: <true/false>

Weapon_Item

Weapon_Info_Display

How to show ammo and other information in the action bar. Uses placeholders and colors. Check out the default weapons for examples.

Display Example
    Weapon_Info_Display:
      Action_Bar:
        Message: "<gold>AK-47<firearm_state> <gray>«<gold><ammo_left><gray>»<gold><reload>"
    Weapon_Info_Display:
      Action_Bar:
        Message: <string>
        Dual_Wield:
          Main_Hand: <string>
          Off_Hand: <string>
      Boss_Bar:
        Title: <string>
        Bar_Color: <string>
        Bar_Style: <string>
        Dual_Wield:
          Main_Hand: <string>
          Off_Hand: <string>
      Show_Ammo_In:
        Boss_Bar_Progress: <true/false>
        Exp_Level: <true/false>
        Exp_Progress: <true/false>

Dual_Wield

Dual-wielding with weapons is always disabled by default. If you want to be able to shoot with both hands at the same time, you'll have to add dual wielding for both weapons while allowing them to dual wield with each other.

Only the other hand may reload the weapon at a time and only other weapon may apply zooming. Both weapons can still shoot simultaneously.

50_GS Dual Wield Example
    Dual_Wield:
      Whitelist: true
      Weapons:
        - "50_GS"
    Dual_Wield:
      Whitelist: <true/false>
      Weapons:
      - <weapon title>
      - <etc.>
      Mechanics_On_Deny: <Mechanics>
  • Whitelist

    • Whether to use Weapons as a whitelist or blacklist.

      • A whitelist means that only X options are allowed to be used.

      • A blacklist means that X options are NOT allowed to be used.

    • true -> Only weapons listed in Weapons can be used.

  • Weapons

    • List of valid weapons. You should enter the weapon titles of the guns.

    • This list's behavior changes based on the value of Whitelist

  • Mechanics_On_Deny

    • These mechanics will be run when dual wielding is denied.

    • Helpful in sending denial messages and denial sounds.

    • Use the Mechanics wiki.

Weapon_Converter_Check

For a regular item to become a "weapon," WeaponMechanics checks if the item should become a weapon. This is the list of checks the plugin goes through to determine if it should convert an item into a weapon. This is especially useful if you want players to get weapons through "vanilla means," like trading.

  • Type

    • Check if the material of the item is the same.

    • Material Examples: stone, stick, emerald.

  • Name

    • Check if the name of the item is the same.

    • Note: If your weapon name has a color (e.g., "<yellow>AK-47"), then the item must have that color.

    • Note: These 2 options are NOT equal "<yellow><yellow>M4A1" ≠ "<yellow>M4A1".

  • Lore

    • Check if the lore of the item is the same.

    • Enable this if you want COMPLETE CONTROL over who gets weapons since regular players cannot give lore to items.

  • Enchants

    • Check if the enchantments of the item are the same.

    • Note: Check both the enchantments AND the levels.

  • Custom_Model_Data

    • Check if the custom model data is the same.

    • This is faster then Lore and Name, and gives good plugin compatibility!

Weapon_Get_Mechanics

Mechanics triggered when getting the weapon through command (/wm give)

  • @Source{} -> The entity being given the weapon.

Weapon_Equip_Mechanics

Mechanics triggered when equipping the weapon in hand.

  • @Source{} -> The entity holding the weapon

Weapon_Equip_Delay

The time, in ticks, after equipping the weapon before it can be shot. This prevents players from switching weapons too quickly to get an unfair advantage. Sidearms should have a lower equip delay then primaries.

Weapon_Holster_Mechanics

Mechanics triggered when holstering the weapon (taking it out of your hand).

  • @Source{} -> The entity holding the weapon

Cancel

Cancels certain events while holding the weapon.

  • Block_Interactions

    • Cancels opening doors, chests, etc.

    • This causes the item to bob up and down; you should not use this.

  • Item_Interactions

    • Cancels tilling dirt, shearing logs, etc.

    • This causes the item to bob up and down; you should not use this.

  • Break_Blocks

    • Cancels breaking blocks.

  • Drop_Item

    • Cancels dropping the gun while holding it.

  • Swap_Hands

    • Cancels swapping hands between main hand and off hand (Pressing F).

  • Arm_Swing_Animation

    • Cancels arm swing animation for other players (Like the punch animation).

Due to visual item bobbing glitches, I recommend using the following configuration for all of your guns:

    Cancel:
      Drop_Item: true
      Swap_Hands: true
      Arm_Swing_Animation: true

Last updated