
CraftTweaker x TaCZ Compatibility
Remove, change or add the TACZ gun smith table recipes with CraftTweaker: guns, ammunition and attachments, from any gunpack or addon. Every item is targeted by its own TACZ id, so editing one weapon never touches the others.
Why this mod ?
Perfect for modpacks, adventure maps and roleplay servers: you decide what can be crafted, and what it costs.
TACZ uses its own crafting table, and all its guns share the same item (tacz:modern_kinetic_gun), which makes its recipes hard to edit. With this mod, you simply write tacz:m4a1 in your script and only the M4A1 changes.
What the mod does
- Remove: one recipe, or every gun, ammunition or attachment recipe at once.
- Change: replace the materials of a recipe, or the number of rounds it crafts.
- Add: create new recipes, with any item or tag as material.
- List: print every recipe and its id in
logs/crafttweaker.log.
Put a .zs file in the scripts folder:
import mods.tacz.GunSmithTable;
// The M4A1 now costs 8 diamonds
GunSmithTable.setGunMaterials("tacz:m4a1", [<item:minecraft:diamond> * 8]);
// The AK47 can no longer be crafted
GunSmithTable.removeGun("tacz:ak47");
// A new recipe: 30 rounds of 9mm for 5 iron nuggets
GunSmithTable.addAmmo("my_9mm", "tacz:9mm", 30, [<item:minecraft:iron_nugget> * 5]);
Changes are applied with /reload or after a restart.
Methods
| Method | Effect |
|---|---|
removeGun(id), removeAmmo(id), removeAttachment(id) |
Removes every recipe producing this id |
removeAllGuns(), removeAllAmmo(), removeAllAttachments() |
Removes a whole category |
removeByRecipeName(name) |
Removes a single recipe |
setGunMaterials(id, materials), setAmmoMaterials(id, materials), setAttachmentMaterials(id, materials) |
Replaces the materials |
setAmmoCount(id, count) |
Changes how many rounds are crafted |
addGun(name, id, materials, attachments) |
Adds a gun recipe (attachments is optional) |
addAmmo(name, id, count, materials) |
Adds an ammunition recipe |
addAttachment(name, id, materials) |
Adds an attachment recipe |
printRecipes() |
Lists all recipes with their ids |
Always give a quantity to a tag, even * 1. Tags are written <tag:items:...> in 1.20.1 and <tag:item:...> in 1.21.1.
Works with TACZ Remoove recipe
Use it with my TACZ Remoove recipe series: your scripts have priority over these mods.
- [TACZ] Remoove recipe gun
- [TACZ] Remoove recipe ammo
- [TACZ] Remoove recipe attachments
- A recipe added or changed by a script stays craftable, even if these mods remove it.
- A recipe removed by a script stays removed.
- Everything your scripts do not mention follows the configuration of these mods.
For example, with Remoove recipe gun removing every weapon, this single line gives back the M4A1:
import mods.tacz.GunSmithTable;
GunSmithTable.setGunMaterials("tacz:m4a1", [<item:minecraft:diamond>]);
Requirements
- Minecraft 1.20.1 with Forge 47 or newer, or Minecraft 1.21.1 with NeoForge 21.1 or newer.
- CraftTweaker.
- [TaCZ] Timeless and Classics Zero.
- Both are optional dependencies: the game starts without them, but the mod then does nothing.
- In multiplayer, the server decides: install the mod on the server. In singleplayer, just install it.
FAQ
Where do I find the id of a weapon ? Add GunSmithTable.printRecipes(); to a script, use /reload, then open logs/crafttweaker.log.
Does it work with my gunpack ? Recipes are found by their TACZ id, whatever the gunpack. Recipes with a "custom" result have no TACZ id: remove them with removeByRecipeName.
My new recipe does not show up on a custom smith table. Some tables only show their own recipes. Give a full recipe name, such as mypack:gun/m4a1.
The script says "Could not find type mods.tacz.GunSmithTable". Check that TACZ is installed and enabled.
License
Mod created by Mozork. All rights reserved.