Skip to content
Mikael E. Wikner edited this page May 14, 2021 · 16 revisions

Getting started

Work in progress!

This is a technical wiki intended for mod developers looking to integrate with tetra in some way, or for those making modpacks or datapacks that want to add, change or remove content from tetra.

If you are looking for guidance on how to play you should look at the ingame advancements.

Datapacks

  1. Set up a datapack (guide)
  2. Enable the output log, allows you to see if there are errors in your datapack (guide)
  3. Turn on tetra development mode in the config (config/tetra.toml, generates if you start minecraft with tetra installed)
  4. Set up resourcepack (needed in most cases) (guide)
  5. Test that both are loaded (/datapacks list && check resource pack screen)

Mod integrations

Not published on any real maven repo so you'll have to use cursemaven, or build and publish to your local maven cache.

  1. Add cursemaven (show how)
  2. Add tetra dependency
  3. Add mgui dependency
  4. Add entry in mods.toml with load orderering set to AFTER

Overview

Concepts

Some of the basic concepts that tetra relies on, some from vanilla and others from forge and tetra.

Attributes

Attributes represent most stats for entities in vanilla, e.g. attack damage, health and armor. Most tetra items modify the attributes of wielding entities when they're held in the mainhand or the offhand.

Documentation on the vanilla attributes can be found here: https://minecraft.fandom.com/wiki/Attribute#Attributes.

Tetra adds four new attributes:

  • tetra:draw_strength: damage for bows and crossbows
  • tetra:draw_speed draw speed for bows and crossbows
  • tetra:ability_damage damage for shields
  • tetra:ability_cooldown cooldown for shields and the holosphere

Forge also adds the following:

  • "forge:entity_gravity": decides how much an entity is affected by gravity
  • "forge:reach_distance": how far away an entity can break blocks (tetra changes this to also affects the range at which one can hit entities)
  • "forge:swim_speed": How fast an entity can swim? (I have not tested this)
  • "forge:nametag_distance": How far away an entity's nametag can be seen? (I have not tested this either)

Tools

Forge introduces ToolTypes which tetra uses to determine which blocks a tool can break, and how fast those blocks are broken. ToolTypes are also used to determine which tools are required to craft modules and improvements.

Has a level and efficiency for each ToolType. The level determines which blocks the tool can break and which modules/improvements it can craft, the efficiency determines how fast it can break blocks (which require the tool).

Tetra uses ToolTypes for some in world block interactions, such as prying open a crate or for fixing a jammed forge hammer. It's possibly to new in world block interactions for other mods.

Forge also adds support for some in world block interactions based on ToolTypes, such as tilling dirt or stripping a log.

This system is backed by strings, a tool exists as long as it's referenced somewhere. Mods that want to add custom tools should keep a reference to their tools in the same way as vanilla does it, pack makers can create new tools by requiring them in a schematic and providing them in a module.

Item effects

Tetra introduces Item effects which are used to apply special effects when an item is used, e.g. bleeding, critical strike or intuit.

Item effects are currently used for right click abilities as well, e.g. bashing or blocking. This will probably change in the future.

There's a list of all item effects available here.

Enchantments

Modular items can hold enchantments like any other, but they're represented as improvements spread across the modules of the item. Replacing a module with an enchantment would also remove the enchantment from the item. Enchantments from other mods are supported but some resources are required for tetra to know

Resources

Most content in tetra can be changed using datapacks, this works both for standalone datapacks and for other mods looking to integrate with tetra. Resources are often referred to as a resource, or as data. Resources exist in a folder structure, the file path for a resource within that structure is often called a resource location.

If there are resources at the same resource location in multiple datapacks they would either merge or be replaced based on the load order of the datapacks and the value of a special replace field within those resources.

The following resources are available:

  • Modules: Modular items are made up of a set of modules, module data defines the stats and effects that those modules should provide for the item.
  • Schematics: Modules are typically crafted in a workbench, schematic data defines which modules can be crafted from which materials and what kind of tools that requires.
  • Improvements: Some modules (based on the slot they go in) can be improved, improvement data defines the stats and effects that those improvements should provide for the item.
  • Enchantments/Destabilization: Enchantment data defines mappings between minecraft enchantments and tetra improvements. Destabilization data defines how negative effects are applied to modules if the magic capacity is exceeded
  • Materials: Material data defines properties for materials, that can then be referenced by modules and schematics to set up variants without lots of repetition
  • Synergies: Some modules provide additional stats when used together, synergy data define which combinations of modules that should provide those bonuses and what those bonuses should be
  • Tweaks: Some modules (like binding bolts) allow the stats of the items to be tweaked in more detail, tweak data defines some rules and which stats that can be tweaked
  • Replacements: Most modular items are not crafted in the regular crafting grid, they're converted into modular items by placing and modifying a regular weapon/tool in the workbench. Replacement data defines which items that can be converted into modular items and which modules & improvements that modular item should start off with
  • Repairs: Repair data can be used to add additional repair materials for a module variant
  • Structures: Tetra generates a bunch of ancient ruins in the world, in addition to the vanilla structure .nbt data tetra uses structure .json data to define how those structures can generate in the world
  • Actions: The workbench allows for actions to be performed on some items (i.e. cracking a geode or repairing a modular item), action data defines simple loot-table based actions and for which items those can be performed
  • Crafting effects: Crafting effects allows for additional effects to be apply based on the context when a module or improvement is crafted

Feel free to hop onto discord and ask for help if you're having issues: https://discord.gg/MyjK4Fx

Clone this wiki locally