# Cheatsheet
ToLaserBlade-Fabric v5.0.0

## Items
### Laser Blade Blueprint
- ID: `tolaserblade:lb_blueprint`
- This item will remain on the crafting grid
- Crafting on Crafting Table: R = Redstone; B = Blue Dye; S = Stick; P = Paper
  - R, B, R;
  - S, P, S;

### LB Energy Cell
- ID: `tolaserblade:lb_battery`
- Crafting on Crafting Table: B = Laser Blade Blueprint; I = Iron Ingot; R = Redstone
  - B;
  - I;
  - R;

### Laser Medium
- ID: `tolaserblade:lb_medium`
- Crafting on Crafting Table: B = Laser Blade Blueprint; x = Glowstone Dust or Diamond
  - B;
  - x;

### Laser Blade Emitter
- ID: `tolaserblade:lb_emitter`
- Crafting on Crafting Table: B = Laser Blade Blueprint; D = Diamond; I = Iron Ingot
  - B;
  - D;
  - I;

### Laser Blade Casing
- ID: `tolaserblade:lb_casing`
- Crafting on Crafting Table: B = Laser Blade Blueprint; I = Iron Ingot
  - B;
  - I;
  - I;

### Laser Blade
- ID: `tolaserblade:laser_blade`
- Tool type: Sword
- Durability: Infinity
- Basic attack damage: 7
- Basic attack speed: 2.8
- Enchanting: Available on Enchanting Table, Anvil, or Smithing Table
- Mining speed: 12
- Mining level: 3
- Crafting on Crafting Table (shapeless recipe):
  - Laser Blade Blueprint
  - LB Energy Cell
  - Laser Medium
  - Laser Blade Emitter
  - Laser Blade Casing

### Laser Blade (fireproof)
- ID: `tolaserblade:laser_blade_fp`
- Basic attack damage: 8
- Mining level: 4
- Upgrading on Smithing Table:
  - Laser Blade + Netherite Ingot

## Features
### Changing Laser Blade colors
Smithing Table:

- Outer blade: Laser Blade Blueprint + Laser Blade + Stained Glass
- Inner blade: Laser Blade Blueprint + Laser Blade + Stained Glass Pane
- Grip: Laser Blade Blueprint + Laser Blade + Carpet
- Switching blend mode of outer blade: Laser Blade Blueprint + Laser Blade + Tinted Glass
- Switching blend mode of inner blade: Laser Blade Blueprint + Laser Blade + Block of Amethyst

### Changing Laser Blade Shape
Smithing Table:

- Type 0 (Standard): Laser Blade Blueprint + Laser Blade + Glass
- Type 1: Laser Blade Blueprint + Laser Blade + Sand
- Type 2: Laser Blade Blueprint + Laser Blade + Sandstone
- Type 526: Laser Blade Blueprint + Laser Blade + Dirt

### Upgrading Laser Blades
Smithing Table:

- Attack speed (up to 4.0): Laser Blade Blueprint + Laser Blade + Gold Ingot
- Attack damage (up to 8): Laser Blade Blueprint + Laser Blade + Block of Diamond
- Light Element: Laser Blade Blueprint + Laser Blade + Glowstone
- Silk Touch: Laser Blade Blueprint + Laser Blade + Prismarine Crystals / Amethyst Shard / Echo Shard
- Looting: Laser Blade Blueprint + Laser Blade + Nautilus Shell / Block of Emerald
- Fireproof: Laser Blade Blueprint + Laser Blade + Netherite Ingot

### Enchantment: Light Element
- ID: `tolaserblade:light_element`
- Enchanting: See Upgrading Laser Blades
- Max level: 10
- Incompatible with Sharpness, Smite, and Bane of Arthropods

Light element increases damage from Laser Blade, and deals additional damage to undead mobs and illagers.

### Laser Trap
When you put a laser blade in a dispenser and activate it, you can attack the mobs (of course, players included) in front of the dispenser with the laser blade.

### Laser Furnace
When a laser trap is fired at a furnace, it will light the furnace.

### Laser Blade Sound Events
You can add audio files that will be played when laser blades are swung.

- `(resource_pack_root_dir)/assets/tolaserblade/sounds/item/laser_blade/swing.ogg`
- `(resource_pack_root_dir)/assets/tolaserblade/sounds/item/laser_blade_fp/swing.ogg`

## Configurations
`(game_dir)/config/tolaserblade.toml`

If you change the config, you will need to restart the game.

### (Common)
In multiplayer mode, server-side config will be used.

- `enableLaserTrap` (boolean, default value is `true`)
  - Enable to attack entities with the laser blade in a dispenser when the dispenser is activated
- `canLaserTrapAttackPlayer` (boolean, default value is `true`)
  - Whether to allow laser trap to attack player. This is only valid when `enableLaserTrap` is `true`
- `canLaserTrapHeatUpFurnace` (boolean, default value is `true`)
  - Whether to allow laser trap to light furnace. This is only valid when `enableLaserTrap` is `true`

### `[client]`
- `laserBlades` (array of strings, default value is `["tolaserblade:laser_blade", "tolaserblade:laser_blade_fp"]`)
  - IDs of items to which laser blade model applies

### Data Components
Item components for laser blade items

Example:
```
/give @p tolaserblade:laser_blade[tolaserblade:lb_atk=8.0f,tolaserblade:lb_spd=1.2f,tolaserblade:lb_mdl={type:2,parts:{grip:{color:-12103854,is_sub:false},in:{color:-1,is_sub:true},out:{color:-1,is_sub:false}}}]
```

### Attack Damage
- Key: `tolaserblade:lb_atk`
- Value: A float value between 0 and 8

### Attack Speed
- Key: `tolaserblade:lb_spd`
- Value: A float value between 0 and 1.2

### Model and Color
- Key: `tolaserblade:lb_mdl`
- Value: The following data compound

```
{
  type: <integer model_type>,
  parts: {
    grip: {
      color: <integer grip_color_in_argb_32>,
      is_sub: false
    },
    in: {
      color: <integer inner_blade_layer_color_in_argb_32>,
      is_sub: <boolean is_inner_blade_layer_subtractive_color>
    },
    out: {
      color: <integer outer_blade_layer_color_in_argb_32>,
      is_sub: <boolean is_outer_blade_layer_subtractive_color>
    }
  }
}
```

## Related Mod
### ToLaserBlade-ExtraModels
A ToLaserBlade add-on to add more laser blade shapes.

https://www.curseforge.com/minecraft/mc-mods/tolaserblade-extramodels
