Creoii Mod Documentation & Wiki
Creo API
Creo API
  • Overview
  • Setup
  • Packages
    • Block API
    • Block Injection API
    • Content Modification API
    • Convention Tags
    • Entity Attributes
    • Entity-Block Collision API
    • Events
    • Food Component API
    • Item API
    • Mod Compatibility API
    • Registry API
    • Shader Interaction API
    • Worldgen
Powered by GitBook
On this page
  • Setup
  • CreoItemSettings
  • CreoItem
  1. Packages

Item API

Extensions giving items more functionality.

Setup

repositories {
    mavenCentral()
}

dependencies {
    modImplementation 'dev.creoii.creoapi:creo-item-api:<VERSION>'
}
repositories {
    mavenCentral()
}

dependencies {
    modImplementation("dev.creoii.creoapi:creo-item-api:<VERSION>")
}

CreoItemSettings

An extension of FabricItemSettings that provides even more customizability for items.

// Delay once the item is dropped until it can be picked up again.
private int pickupDelay;

// How long it takes for the item to despawn.
private int despawnTime;

// Whether the item floats or sinks in fluids.
private boolean buoyant;

// The amount of downwards gravity applied to the item when dropped.
private double gravity;

// How fast a Hopper transfers the item to another Hopper or container.
private int hopperTransferRate;

// How fast the item rotates when on the ground.
private float rotationModifier;

// Makes the item picked up by right-clicking instead of collision.
private boolean clickPickup;

// What fuel items are required to smelt this item, if smeltable.
private RegistryEntryList<Item> requiredFuels;

CreoItem

CreoItem.java
// Determines whether CreoBlock#onAttackThroughBlock can be called.
boolean canAttackThroughBlock(ServerPlayerEntity player, ItemStack stack, Entity target);

// Called when the item attacks an entity through a block.
void onAttackThroughBlock(ServerPlayerEntity player, ItemStack stack, Entity target);
PreviousFood Component APINextMod Compatibility API

Last updated 1 year ago