Temporal API

Quick rating

Temporal API

No reviews yet

Temporal API is the library for Team Temporal mods, other projects may use it as well.

No Theme
No Genre
API/Library
Mod Loaders
Forge
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
License
All Rights Reserved
Latest Version
Temporal API 1.9.0
Authors
Modrinth

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

About

Description

description_b5fc750d-2822-4a40-9419-8a711875fc9e.png

Welcome to the Temporal API - the official page for the Temporal API Minecraft modding framework.

Temporal API is a framework designed to simplify the whole development process by reducing boilerplate and letting modders focus only on unique features. It does not add gameplay features to players directly - it exists to help mod developers deliver content faster. It provides utilities, abstractions, and extension points to streamline mod development on NeoForge (currently only NeoForge).


Core Purpose

The main goal of Temporal API is to make creating Minecraft mods easier and more flexible.

It provides foundational systems such as:

  • Object Factories
  • Event Handlers
  • Annotation Processors
  • Simplified Datagen using Annotations
  • Automated Registries and Events
  • And much more

All of these aim to reduce repetitive code and complexity for mod developers.


Support and Community

If you need help, you can:

  • Open issues on the GitHub repo
  • Join the Team Temporal [Discord](https://discord.gg/5dKKA4fUga)
  • Or you can write to me directly in Discord: `w4t3rcs` 

Contributing

Temporal API is an evolving library - contributions are welcome!

Before contributing:

  1. Follow the coding and documentation standards
  2. Submit issues or pull requests via GitHub
  3. Or you can write to me directly in Discord: `w4t3rcs` 

Want to Know More?

Check out the project Wiki and Example mod!

FAQ:

Will This Mod Be Getting A Fabric Version?
No, a fabric version is not planned
 
Can I use this mod in my Modpacks?
Yes, feel free to use this mod in any modpack!

How do I suggest features or report Bugs?
Join our Discord above for any comments, questions, suggestions, or problems!

Temporal API is the official library for the Team Temporal mods other projects and modders and modpack creators may use it for their projects as much as they like.

The main goal of this mod is to make creating mods easier and more flexible!

For working with our library you need to go to build.gradle and add this:

repositories {
    maven {
        url "https://cursemaven.com"
    }
}

dependencies {
    implementation fg.deobf("curse.maven:temporalapi-970291:<file-id>")
    
    ...
}

You need to replace with file id that can be found in the end of link of needed version of the mod file.

The library for current state adds

factories, tag utils, creative tab utils, trading with villagers and wanderers customizer, world features utils, item properties utils, fov modifier etc Factory and Extensions Factories are used to create RegistryObject objects and make their creation a lot easier.

For using ItemFactory from API you need to create ItemFactoryFacade class like here:

public class ModItemFactoryFacade extends ItemFactory {
    public ModItemFactoryFacade() {
        super(ModItems.ITEMS);
    }
}

Also you can extend your Factory Facade with Extensions from API or create your own Extension.

Here are 2 examples of using SwordExtension (with this Extension creating of Sword becomes a lot easier):

Like this:

public class ModItemFactoryFacade extends ItemFactory implements SwordExtension {
    public ModItemFactoryFacade() {
        super(ModItems.ITEMS);
    }
}

Or like this:

public class ModItemFactoryFacade extends ItemFactory implements SwordExtension {
    public ModItemFactoryFacade() {
        super(ModItems.ITEMS);
    }

    public RegistryObject<SwordItem> createSword(String name, Object... args) {
        return SwordExtension.super.createSword(name, this, args);
    }

    public RegistryObject<? extends SwordItem> createSword(String name, Supplier<? extends SwordItem> tTypedSupplier) {
        return SwordExtension.super.createSword(name, this, tTypedSupplier);
    }
}

So what about creating our object using this Facade class:

public class ModItems {
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(Registries.ITEM, "MOD_ID");
    public static final ModItemFactoryFacade ITEM_FACTORY = new ModItemFactoryFacade();

    public static final RegistryObject<Item> MY_ITEM_1 = ITEM_FACTORY.create("my_item_1");
    public static final RegistryObject<Item> MY_ITEM_2 = ITEM_FACTORY.create("my_item_2", new Item.Properties());
    public static final RegistryObject<Item> MY_ITEM_3 = ITEM_FACTORY.create("my_item_3", () -> new Item(new Item.Properties()));

    //First example of creating Facade object from up
    public static final RegistryObject<SwordItem> MY_SWORD_1 = ITEM_FACTORY.createSword("my_sword_1", ITEM_FACTORY, Tiers.STONE, 3, -2.4F);
    public static final RegistryObject<? extends SwordItem> MY_SWORD_2 = ITEM_FACTORY.createSword("my_sword_2", ITEM_FACTORY, () -> new SwordItem(Tiers.STONE, 3, -2.4F, new Item.Properties()));


    //Second example of creating Facade object from up
    public static final RegistryObject<SwordItem> MY_SWORD_3 = ITEM_FACTORY.createSword("my_sword_3", Tiers.STONE, 3, -2.4F);
    public static final RegistryObject<? extends SwordItem> MY_SWORD_4 = ITEM_FACTORY.createSword("my_sword_4", () -> new SwordItem(Tiers.STONE, 3, -2.4F, new Item.Properties()));
}

Now lets's look on args... array. It is an array of arguments for creating an object (Will be changed in future for better readability).

Currently available Factories and extensions:

ItemFactory (ArrowExtension, BowExtension, BowlExtension, MusicDiscExtension, SmithingTemplateExtension, SwordExtension, AxeExtension, PickaxeExtension, ShovelExtension, HoeExtension)
BlockFactory (BushExtension, FlowerExtension, PottedFlowerExtension)
ParticleFactory
EffectFactory
PaintingFactory
PotionFactory
SoundEventFactory
CreativeTabFactory
EntityFactory
Tag Utils
Tag utils focus on tag creating and making using tags easier.

For example if you want to create item tag you need to use ItemTagFactory:

public class MyItemTags {
    public static final TagFactory<Item> TAG_FACTORY = new ItemTagFactory("MY_MOD_ID");

    public static final TagKey<Item> MY_TAG = TAG_FACTORY.createTag("my_tag");
}
Creative Tab Utils
Creative tab utils are used to add items to Creative Tab that you need.

Firstly we need to go to our class that subscribed for mod events and add this function (inner part of method is just example):

@SubscribeEvent
public void addCreativeTabs(BuildCreativeModeTabContentsEvent event) {
    new SimpleTabAdder(event)
            .addAllToTab(CreativeModeTabs.INGREDIENTS, ModItems.MY_ITEM_1, ModItems.MY_ITEM_2, ModItems.MY_ITEM_3)
            .addAllToTab(CreativeModeTabs.COMBAT, ModItems.MY_SWORD_1, ModItems.MY_SWORD_2, ModItems.MY_SWORD_3);
}

Trading with Villagers and Wanderers Utils TemporalAPI makes trading a lot easier. Here is an example of it:

public static final TradeCustomizer tradeCustomizer = new SimpleTradeCustomizer();

@SubscribeEvent
public void customizeTradesWithVillagers(VillagerTradesEvent event) {
    tradeCustomizer.customize(event, new VillagerTrade(
            new TradingItemHolder(Items.ANDESITE, 2),
            new TradingItemHolder(Items.EMERALD, 3),
            new VillagerTradeDescription(
                    VillagerProfession.ARMORER, 1, 5, 5, 0.5f
            )
    ));
}

@SubscribeEvent
public void customizeTradesWithWanderers(WandererTradesEvent event) {
    tradeCustomizer.customize(event, new WandererTrade(
            new TradingItemHolder(Items.ANDESITE, 2),
            new TradingItemHolder(Items.EMERALD, 3),
            new WandererTradeDescription(
                    WandererTradeDescription.TradeRarity.RARE, 5, 5, 0.5f
            )
    ));
}

World Features Utils Will be expanded in the next updates.

Item Properties Utils Adding needed properties to bows, shields, etc.

@SubscribeEvent
public void clientSetup(final FMLClientSetupEvent event) {
    event.enqueueWork(() -> {
        TemporalItemProperties.makeBow(ModItems.MY_BOW_1);
        TemporalItemProperties.makeShield(ModItems.MY_SHIELD_1);
        TemporalItemProperties.makeCrossbow(ModItems.MY_CROSSBOW_1);
        TemporalItemProperties.putCompostable(ModBlocks.MY_FLOWER_1, 4);
    });
}

FAQ:

Will This Mod Be Getting A Fabric Version: No a fabric version is not planned

Can I use this mod in my Modpacks: Yes, feel free to use this mod in any modpack!

How Do I suggest features or report Bugs: Join our discord above for any comments, questions, suggestions, or problems!

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

14.8m
Total Downloads
CurseForge
14.7m
Modrinth
~140,000
Last Updated
CurseForge
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works