K-Turrets overview

K-Turrets is a Minecraft mod which adds 6 turrets and combat drones. Turrets protect areas from hostile mobs. Drones work similarly to turrets, but are mobile and have lower stats. I will refer to drone or turret as 'unit' if the contextual information applies to both object types during the overview.

Unit can be obtained by crafting its respective item. First you must obtain titanium ingots, which are smelted from raw titanium in the blast furnace, which drops from titanium ore generating in the Overworld.

Turret recipes have following pattern - 6 titanium ingots, a dispenser, and type-specific ingredient on sides:

Drone recipes have following pattern - 4 titanium ingots, 2 feathers, a dispenser and type-specific ingredient on sides:

You can configure unit via a uI which is accessed by Shift + right click on the unit.

On the left side there is a list of applicable targets, represented by a toggle button with the entity's registry name. On the right side there are several controls, integrity (health) indicator and a couple of hints. To remove a target, press on it - it will appear crossed out. Once you removed desired targets, close the screen to apply the changes. To add a target, use the text field on top - write full registry name and then press 'Add...'button. While you write, a list of suggestions will be displayed below. You can click on a suggestion to copy it into the text field.

You can exclude players from targets using the same text field by typing in a player's name prefixed by '!'. Excluded players will appear at the top of the target list.

Pressing 'Dismantle' will drop the unit in item form (its state and ammo will be saved). There is another button that toggles unit's pushability, and another button which controls whether a unit will attack players who are not allied to you. "Claim" button will make a unit yours.

Another button will show up in drone uI which controls whether a drone is following its owner, staying or guarding.

Dismantling a unit will produce an item that has unit's data written on it; you can see unit's uuID in the tooltip. using such item will place that unit and load its data.

If unit is damaged, you can repair it with a titanium ingot by Shift + right clicking it. Drone recovers 1/4 of integrity from 1 ingot, and turret recovers 1/6 of integrity.

By default unit's targets are all potentially hostile mobs. If you want it to shoot players that are not allied to you, you must toggle the mentioned control button.

To access unit's inventory, right click it. There you can load it with appropriate ammo.

Hoppers can insert ammo into units.

You can hold 'K' key to highlight locations of your drones in 128 block range around you (even through blocks):

Behavior

Turret: if it has ammo (and weapon if it's an Arrow turret), it will shoot at its targets within range.

Turret can be put into a minecart.

Drone: same as turret, but will pursue the target. If is set to follow the owner, will fly towards his body. When attacking a mob, a drone will move sideways and move back if an attacking mob is too close.

Drones have less slots for ammo.

Units won't hurt friendly mobs unless they are in the target list.

Turrets will take ammo from adjacent inventories if 'refill inventory' toggle is enabled in the configuration screen.

Types

There are following types of units:

  1. Arrow: can use all kinds of arrows as ammo. Flame, Punch, Power enchantments on the bow are applicable by arrow units.
  2. Bullet: can use gold and iron nuggets as ammo.
  3. Brick: can use bricks and nether bricks as ammo.
  4. Cobble: can use all items under tag "stone_tool_materials" as ammo.
  5. Fireball: uses explosive powder as ammo; immune to fire. Explosive powder is crafted from gunpowder and blaze powder.
  6. Gauss: uses gauss bullets as ammo.
  7. Storage Drone: carries items.

Configuration

Each turret type's stats can be configured separately, such as health, range, armor, fire rate, damage. By default, their stats are identical except damage; turrets ranked by damage, from lowest: cobble, firecharge, arrow, bullet, brick, gauss. If you change the range, then the new value will be applied to only newly placed units.

Turret default values:

Health = 60

Armor = 3

Range = 32

Fire rate = 20 (1 second)

Drones' stats are derived from appropriate turrets' stats like this:

Health = Turret Health * 85%

Range = Turret Range - 5

Armor = Turret Armor * 34%

Other stats are identical, though their inventory has 1 row of slots less.

If you need, you can change ammo items by making a datapack with ammo item tags. Datapack layout:

            -data
                -k_turrets
                    -tags
                        -items
                            arrow_unit_ammo.json
                            bullet_unit_ammo1.json
                            bullet_unit_ammo2.json
                            brick_unit_ammo1.json
                            brick_unit_ammo2.json
                            cobble_unit_ammo.json
                            fireball_unit_ammo.json
                            gauss_unit_ammo.json
        
Bullet and brick units have two types of ammo, which deal slightly different damage.

You can turn on drone propeller sound in the client config.

You can define what mobs will be excluded from default targets in the config.

You can configure amount of titanium ore generated in 1.16.5-1.19.2 versions of the mod. Versions 1.20.1 and up require a datapack.

In the server config (which can be found in "world/serverconfig" directory) there are defined limits of drone and turret count per player and per dimension. A player will not be able to place new drones or turrets if he reaches the limits. Default values are 10 for drones and 10 for turrets.

You can toggle ammo refill, which will make unit to take ammo from adjacent inventories.

You can copy target filters and exceptions from one unit to the other using Filter Copier.

You can make unit projectiles ignore mob damage cooldown using this datapack (for versions 1.20.1 and up).

Ammo Reloader

Ammo Reloader is a block that reloads drone ammo. It can be automated, and reloads drones in 6 block range. It has 6 rows of slots for each drone ammo type.

Tricks and non-obvious info

  1. Place your turrets on an elevated blocks, so it is harder for melee mobs to reach them.
  2. Units are immune to poison, wither, hunger, health, health boost and regeneration effects.
  3. Turrets can be put into minecarts.
  4. Vanilla team system is taken into account by unit targeting.
  5. Units can't drown.

How to get a lot of ammo

Here are good sources of ammo: