# Cheatsheet

Chili Bullet Weapons
Version 2.0.0

- [Chili Bullet Weapons](https://iunius118.github.io/ChiliBulletWeapons/)
- [CBW Chili Peppers and Foods](https://github.com/Iunius118/CBWChiliPeppersAndFoods)

## Requirements

- NeoForge version - NeoForge
- Forge version - Minecraft Forge
- Fabric version - Fabric Loader, Fabric API, and Cloth Config API
- CBW Chili Peppers and Foods v1.2.0+

## How to Get Started

### 1. Obtain Curved Chili Pepper

Curved chili peppers can be obtained from breaking short grass.

### 2. Craft Chili Pepper Seeds

Chili pepper seeds can be crafted from curved chili pepper.

### 3. Grow Chili Pepper Crops

Chili pepper seeds can be placed on farmland by right-clicking, where they grow through eight stages.

Breaking the final stage produces 1 to 3 curved chili peppers and 1 to 3 bullet-like chili peppers.

## Farming

### Chili Pepper Seeds (CBW)

Chili pepper seeds can be obtained from curved chili pepper that can be obtained by breaking short grass or mature chili pepper crops.

When extracting chili pepper seeds from a curved chili pepper, use a crafting table or the player’s crafting grid.

Crafting:

- Curved Chili Pepper -> Chili Pepper Seeds

### Chili Pepper Crops (CBW)

Chili pepper seeds can be planted on farmland and the crops will grow to stage eight.

Chili peppers can be harvested from the crop in the seventh or final growth stage.

Items produced when crops are broken at each stage:

- Stage 1-6 - 1x Chili Pepper Seeds (CBW)
- Stage  7  - 1-3x Curved Green Chili Pepper
- Stage  8  - 1-3x Curved Chili Pepper and 1-3x Bullet-like Chili Pepper

If harvested with Fortune enchanted tool, the number of chili peppers dropped will increase.

For more information on the use of curved chili peppers, refer to CBW Chili Peppers and Foods mod.

### Compact Storage of Chili Peppers

Sack of chili peppers can be used to store chili peppers in a compact fashion.

Crafting:

- 9x Bullet-like Chili Pepper <-> 1x Sack of Bullet-like Chili Peppers

### Chili Plant Biofuel

Chili plant biofuel is a solid fuel made from biomass of chili pepper plants and can be used as fuel (1:20) in furnaces.

Crafting (shaped recipe):

    Chili Plant Biofuel
    4x String of Curved Chili Peppers/Sack of Curved Chili Peppers/Sack of Bullet-like Chili Peppers (s)
    | s | s |
    | s | s |

### Composting

The following item can be added to composters:

- Bullet-like Chili Pepper

## Weapons

### Bullet Chili Arrow

A bullet chili arrow serves as ammunition for bows, crossbows, and dispensers.

Crafting (shapeless recipe):

- Arrow + Bullet-like Chili Pepper -> Bullet Chili Arrow
- Arrow + Chili Bullet -> Bullet Chili Arrow

When a bullet chili arrow is shot and hits an entity or a block, it causes a small explosion, dealing explosive damage to nearby entities.

Power enchanted bows increase the explosive power and Multishot enchanted crossbows increase the number of bullet chili arrows shot.

### Chili Bullet

A chili bullet serves as ammunition for chili bullet guns and can be crafted from a bullet-like chili pepper.

Crafting:

- Bullet-like Chili Pepper -> Chili Bullet

Chili bullets will disappear two seconds after they are fired.

When a chili bullet hits an entity, there is a 10% chance of a critical hit.

### Chili Bullet Gun

A chili bullet gun is a break-action single-shot gun that shoots chili bullets to attack mobs at a distance.

Crafting (shaped recipe):

    Chili Bullet Pistol
    2x Iron Ingot (i), 1x Chili Bullet (b), and 1x any planks (p)
    | i |   |   |
    |   | i |   |
    |   | p | b |

Chili bullet guns can be shot with the same operation as crossbows.
Specifically, unloaded guns can be loaded by holding down the right mouse button, and loaded guns can be shot by right-clicking.

The following enchantments can be applied to chili bullet guns:

- Unbreaking
- Mending
- Curse of Vanishing

A chili bullet gun is named Chili Bullet Pistol when crafted, but the display name and appearance may change with upgrades.

The display names and upgrades are listed below:

- Chili Bullet Pistol     - A gun not yet upgraded with any gun barrel upgrades and bayonet upgrades
- Chili Bullet Rifle      - Upgrade a pistol with a gun barrel upgrade
- Chili Bullet Volley Gun - Upgrade a pistol with 2 gun barrel upgrades
- Chili Bullet Pistol with Bayonet     - Upgrade a pistol with a bayonet upgrade
- Chili Bullet Rifle with Bayonet      - Upgrade a pistol with a gun barrel upgrade and a bayonet upgrade
- Chili Bullet Volley Gun with Bayonet - Upgrade a pistol with 2 gun barrel upgrades and a bayonet upgrade

A chili bullet rifle is highly accurate and powerful, and a bullet from it pass through three entities.

A chili bullet volley gun is less accurate, and it can fire four bullets in a single shot but also have four times the ammunition consumption and wear per shot.

A chili bullet gun with bayonet is a chili bullet gun with a bayonet fitted and can deal 6 (heart × 3) damage in melee combat.

A chili bullet gun with custom name will have a reduced chance of durability reduction.

#### Upgrading Guns

Chili bullet guns can be upgraded by using upgrade items.

To upgrade a chili bullet gun, follow these steps:

1. Hold a gun in the off-hand
2. Hold an upgrade item in the main hand
3. Use (right-click) the item in the main hand

Currently, there are three types of upgrade items available.

- Bayonet Upgrade       - Upgrades a gun to a gun with bayonet
- Gun Barrel Upgrade    - Upgrades a pistol to a rifle and a rifle to a volley gun
- Gun Mechanism Upgrade - Decreases loading time of a gun (up to three times)

Crafting (shaped recipe):

    Bayonet Upgrade
    2x Iron Ingot (i), 1x Stick (s), 4x Chili Bullet (b), and 2x Gold Ingot
    | i | b | g |
    | b | i | b |
    | g | b | s |

    Gun Barrel Upgrade
    3x Iron Ingot (i) and 6x Chili Bullet (b), 4x Chili Bullet (b), and 2x Gold Ingot
    | i | b | g |
    | b | i | b |
    | g | b | i |

    Gun Mechanism Upgrade
    1x Any planks (p), 2x Iron Ingot (i), 4x Chili Bullet (b), and 2x Gold Ingot
    | p | b | g |
    | b | i | b |
    | g | b | i |

#### Mod Data Components for Guns

This mod adds some data components to save the state of the chili bullet gun.
The following is a description of the main data components among them.

- `chilibulletweapons:gun_contents` - Contains upgrade data of a gun
  - `quick_loading` - Number of loading time upgrades (non-negative integer, default is 0)
  - `piercing` - Number of entities bullet can penetrate (integer between 0 and 5, default is 0)
  - `barrel_count` - Number of barrel (integer between 1 and 4, default is 1)
  - `show_in_tooltip` - Whether to show upgrade data in tooltip (boolean, default is true)
- `chilibulletweapons:bayoneted` - Bayonet attack damage value (float). If set, this gun is fitted with a bayonet
- `chilibulletweapons:fixed` - If set, this gun cannot be upgraded
- `chilibulletweapons:dyed_gun_colors` - Contains colors of a gun. If set, a special model is used to dye the gun
  - `metal_rgb` - Color of metal parts (integer in RGB24 format, default is 16777215)
  - `wood_rgb` - Color of wooden parts (integer in RGB24 format, default is 16777215)
  - `blade_rgb` - Color of bayonet blade (integer in RGB24 format, default is 16777215)
  - `show_in_tooltip` - Whether to show color values in tooltip (boolean, default is true)

These data components can be used for commands or custom recipes.

A command example:

    /give @p chilibulletweapons:gun[chilibulletweapons:gun_contents={quick_loading:5,piercing:1,barrel_count:2},chilibulletweapons:bayoneted=5f,chilibulletweapons:fixed={},chilibulletweapons:dyed_gun_colors={metal_rgb:3355443,wood_rgb:10027008,blade_rgb:16764108},minecraft:custom_name='"Unguis Accipitris"',minecraft:enchantments={levels:{"minecraft:vanishing_curse":1}}]

Note that this command is too long for chat and should be executed by command block.

A recipe example:

    {
      "type": "minecraft:crafting_shaped",
      "category": "equipment",

      /* Define ingredients and pattern here */

      "result": {
        "components": {
          "chilibulletweapons:gun_contents": {
            "quick_loading": 5,
            "piercing": 1,
            "barrel_count": 2
          },
          "chilibulletweapons:bayoneted": 5.0,
          "chilibulletweapons:fixed": {},
          "chilibulletweapons:dyed_gun_colors": {
            "metal_rgb": 3355443,
            "wood_rgb": 10027008,
            "blade_rgb": 16764108
          },
          "minecraft:custom_name": "\"Unguis Accipitris\"",
          "minecraft:enchantments": {
            "levels": {
              "minecraft:vanishing_curse": 1
            }
          }
        },
        "count": 1,
        "id": "chilibulletweapons:gun"
      }
    }

### Chili Bullet Machine Gun

A chili bullet machine gun is an automatic gun that shoots chili bullets to attack mobs at a distance.

Crafting (shaped recipe):

    Chili Bullet Machine Gun
    2x Netherite Ingot (n), 1x Chili Bullet (b), and 1x Crimson Planks/Warped Planks (p)
    | n |   |   |
    |   | n |   |
    |   | p | b |

A chili bullet machine gun can resist fire and lava when dropped as an item.

A chili bullet machine gun can be loaded with the first bullet by holding down the right mouse button, and then the right mouse button can be used to shoot until the inventory runs out of bullets.

The following enchantments can be applied to chili bullet machine gun:

- Unbreaking
- Mending
- Curse of Vanishing

In survival mode, Unbreaking and Mending enchantments are highly recommended, as chili bullet machine gun is not durable!

A chili bullet machine gun with custom name will have a reduced chance of durability reduction.

Chili bullet machine gun cannot be upgraded with any upgrade items.

## Configuration

The configuration is saved in file `config/chilibulletweapons.toml`.

### Common

```toml
# The common section contains configuration values referenced by both the server and the client.
# In multiplayer mode, server-side values are used.
[common]

# A Boolean value of canMultishotMultiHit represents whether a single target can be damaged multiple times at once by bullets shot from a volley gun.
# If set to false, a single target will take damage from only one bullet at the same time.
canMultishotMultiHit = true

# A real number between 0 and 8 of chiliArrowDamageMultiplier represents the multiplier of the explosive power of bullet chili arrows.
chiliArrowDamageMultiplier = 1.0

# A non-negative real number of chiliBulletBaseDamage represents the base damage amount of a chili bullet fired from a gun.
# If set to 0, chili bullets will do no damage.
# Formula for chili bullet damage (only when chiliBulletBaseDamage > 0):
#   speed (initial) = 3 (pistol/volley gun/machine gun) or 4 (rifle)
#   minDamage = ceil(speed * speed * chiliBulletBaseDamage)
#   maxDamage = floor(minDamage * 1.5) + 1
#   damage = a random integer between minDamage and maxDamage
chiliBulletBaseDamage = 0.85
```
