Custom Items
KubeJS TFC allows for the create of some of TFC’s item types
-
Chisel –
tfc:chisel -
Fishing Rod –
tfc:fishing_rod -
Glass Bottle –
tfc:glass_bottle -
Glassworking –
tfc:glassworking -
Glassworking Tool –
tfc:glassworking_tool -
Hammer –
tfc:hammer -
Hoe –
tfc:hoe -
Javelin –
tfc:javelin -
Jug –
tfc:jug -
Mace –
tfc:mace -
Mold –
tfc:mold -
Prospector’s Pick –
tfc:propick -
Scythe –
tfc:scythe -
Tool –
tfc:tool -
Windmill Blade –
tfc:windmill_blade
If Precision Prospecting
is installed, the following item type is supported
- Prospector –
precisionprospecting:prospector
Chisel
Type: tfc:chisel
Creates a new chisel item
Inherits the methods of the default item builder
Extra Methods
: Set the tool tier of the chisel.tier(t: Tier)
: Set the base attack damage of the chisel.attackDamageBaseline(f: number)
: Set the base attack speed of the chisel.speedBaseline(f: number)
: Modifies the tool tier of the chisel.modifyTier(tier: Consumer<MutableToolTier>)
: Set the attack damage bonus of the chisel’s tool tier.attackDamageBonus(f: number)
: Set the attack speed bonus of the chisel’s tool tier.speed(f: number)
Example
StartupEvents.registry('item', event => {
event.create('chisel', 'tfc:chisel')
.texture('tfc:item/metal/chisel/copper')
})
Fishing Rod
Type: tfc:fishing_rod
Creates a new TFC fishing rod item
Inherits the methods of the default item builder
Extra Methods
: Set the strength of the fishing rod, defaults to.fishingStrength(f: number)1
: Set the model to use while the rod is cast, defaults to.castModel(model: ResourceLocation)minecraft:item/fishing_rod/cast
: Allow the rod to accept small bait by adding it to the.smallBait()tfc:holds_small_fishing_baittag
: Allow the rod to accept large bait by adding it to the.largeBait()tfc:holds_large_fishing_baittag
Example
StartupEvents.registry('item', event => {
event.create('fishing_rod', 'tfc:fishing_rod')
.fishingStrength(12)
.texture('minecraft:block/dirt')
.largeBait()
})
Glass Bottle
Type: tfc:glass_bottle
Creates a new glass bottle item
Inherits the methods of the jug item builder
Extra Methods
: Set the chance, in the range.breakChance(chance: number)[0, 1], the bottle will break each time it is drunk from. Defaults to0.5
: Set the chance, in the range.breakChanceSupplier(chance: Supplier<number>)[0, 1], the bottle will break each time is drunk from via a supplier. Defaults to() => 0.5
Example
StartupEvents.registry('item', event => {
event.create('glass_bottle', 'tfc:glass_bottle')
.breakChance(0.05)
.capacity(120)
.allowedFluids('kubejs:glass_safe')
})
Glassworking
Type: tfc:glassworking
Creates a new item which can perform a glassworking operation
Inherits the methods of the default item builder
Extra Method
: Set the operation the item performs. A full list of available operations can be obtained by running the command.operation(operation: Holder<GlassOperation>)/kubejs dump_registries tfc:glass_operationin-game
Example
StartupEvents.registry('item', event => {
event.create('glassworking', 'tfc:glassworking')
.operation('tfc:saw')
})
Glassworking Tool
Type: tfc:glassworking_tool
Creates a new tool item which can perform a glassworking operation
Inherits the methods of the tool item builder
Extra Method
: Set the operation the tool performs, defaults to.operation(operation: holder<GlassOperation>)tfc:saw. A full list of available operations can be obtained by running the command/kubejs dump_registry tfc:glass_operationin-game
Example
StartupEvents.registry('item', event => {
event.create('glass_knife', 'tfc:glassworking_tool')
.operation('kubejs:cut')
.knife()
})
Hammer
Type: tfc:hammer
Creates a new hammer item
Inherits the methods of the chisel item builder
Extra Method
: Set the texture the hammer uses while in a trip hammer and add the hammer to the.tripHammerTexture(texture: ResourceLocation)tfc:trip_hammerstag
Example
StartupEvents.registry('item', event => {
event.create('hammer', 'tfc:hammer')
.tripHammerTexture('tfc:block/metal/smooth/red_steel')
.speed(1.5)
})
Hoe
Type: tfc:hoe
Creates a new TFC hoe item
Inherits the methods of the chisel item builder
Example
StartupEvents.registry('item', event => {
event.create('hoe', 'tfc:hoe')
.texture('minecraft:item/diamond_hoe')
})
Javelin
Type: tfc:javelin
Creates a new javelin item
Inherits the methods of the chisel item builder
Extra Methods
: Prevent an extension, which renders the thrown javelin entity in the hand in first and third person, from being registered.customHeldModel()
: Set the texture used for the thrown entity of the javelin.thrownTexture(texture: ResourceLocation)
: Set the model to use while throwing/charging the javelin.throwingModel(model: ResourceLocation)
: Set the base damage the javelin inflicts when in entity form. Defaults to 1.5 times the javelin’s tier attack damage bonus.thrownDamage(damage: number)
: Allow skeletons to spawn with the javelin by adding it to the.skeletonWeapon()tfc:skeleton_weaponstag
: Set the model to display at a specific display context.modelAtPerspective(perspective: ItemDisplayContext, model: ResourceLocation)
: Set the model generation at a specific display context.fullModelAtPerspective(perspective: ItemDisplayContext, model: Consumer<ModelGenerator>)
: Set the model to display in the.guiModel(model: ResourceLocation)none,fixed,ground, andguidisplay contexts
: Set the model generation for the.guiFullModel(model: Consumer<ModelGenerator>)none,fixed,ground, andguidisplay contexts
Example
StartupEvents.registry('item', event => {
event.create('javelin', 'tfc:javelin')
.thrownTexture('tfc:block/metal/smooth/blue_steel')
.thrownDamage(12)
.guiModel('kubejs:item/blue_stick')
})
Jug
Type: tfc:jug
Creates a new jug item
Inherits the methods the default item builder
Extra Methods
: Set the.filledDisplayName(text: String)en_ustext of the jug’s display when it contains fluid. The%stemplate can be used to place the fluid’s name where wanted
: Set the base and fluid overlay texture of the jug’s model. See an example from TFC for what an overlay texture should look like.textures(base: String, fluid: String)
: Set how much fluid, in mB, the jug can hold. Defaults to.capacity(amount: int)100
: Set how much fluid, in mB, the jug can hold via a supplier. Defaults to.capacitySupplier(amount: Supplier<int>)() => 100
: Set which fluids the jug can hold via a tag, defaults to.allowedFluids(allowed: TagKey<Fluid>)tfc:usable_in_jug
Example
StartupEvents.registry('item', event => {
event.create('jug', 'tfc:jug')
.filledDisplayName("Big 'ol Jug of %s")
.displayName('Big Jug')
.textures('tfc:item/ceramic/jug_empty', 'tfc:item/ceramic/jug_overlay')
.capacity(5000)
})
Mace
Type: tfc:mace
Creates a new mace item
Inherits the methods of the chisel item builder
Example
StartupEvents.registry('item', event => {
event.create('mace', 'tfc:mace')
.speedBaseline(0.8)
.modifyTier(tier => {
tier.setUses(3000)
})
})
Mold
Type: tfc:mold
Creates a new mold item
Inherits the methods of the default item builder
Extra Methods
.moldTable(pattern: String[14], textures?: Map<String, String>): Allow the mold to be put in the mold table by adding it to thetfc:usable_in_mold_tabletag and generating a model for itpattern: String[14]: An array of strings, the shape of the model in the model table. The array must have 14 values, each 14 characters long. Empty spaces will be ‘carved out’textures?: Map<String, String>: The textures of the model in the mold table. The texture keys are0andparticle. Optional, defaults to addingtfc:block/moldto both
: Set the base and fluid overlay texture of the mold’s model. See TFC for what an overlay texture should look like.textures(base: String, fluid: String)
: Set how much fluid, in mB, the mold can hold. Defaults to.capacity(amount: int)100
: Set how much fluid, in mB, the mold can hold via a supplier. Defaults to.capacitySupplier(amount: Supplier<int>)() => 100
: Set which fluids the mold can hold via a tag, defaults to.allowedFluids(allowed: TagKey<Fluid>)tfc:usable_in_jug
Example
StartupEvents.registry('item', event => {
event.create('happy_mold', 'tfc:mold')
.textures('kubejs:item/happy_mold_empty', 'kubejs:item/happy_mold_overlay')
.capacity(15)
.allowFluids('kubejs:happy_fluids')
.moldTable([
'XXXXXXXXXXXXXX',
'XXXXXXXXXXXXXX',
'XXXXXXXXXXXXXX',
'XX XXXXXX XX',
'XX XXXXXX XX',
'XXXXXXXXXXXXXX',
'XXXXXXXXXXXXXX',
'X XXXXXXXXXX X',
'X XXXXXXXXXX X',
'XX XXXXXXXX XX',
'XXX XXXX XXX',
'XXXXX XXXXX',
'XXXXXXXXXXXXXX',
'XXXXXXXXXXXXXX'
])
})
Prospector’s Pick
Type: tfc:propick
Creates a new prospector’s pick item
Inherits the methods of the chisel item builder
Extra Method
: Set the integer level of the pick, determines the chance the pick reports a false negative. The chance is calculated from the level as.level(level: int)0.3 - level * (0.3 / 5)wherelevelis clamped to the range[0, 5]
Example
StartupEvents.registry('item', event => {
event.create('propick', 'tfc:propick')
.level(4)
.texture('minecraft:block/sand')
})
Scythe
Type: tfc:scythe
Creates a new scythe item
Inherits the methods of the chisel item builder
Example
StartupEvents.registry('item', event => {
event.create('scythe', 'tfc:scythe')
.modifyTier(tier => tier.setUses(2000))
.texture('minecraft:item/shears')
})
Tool
Type: tfc:tool
Creates a new generic tool item
Inherits the methods of the chisel item builder
Extra Methods
: Set the block tag the tool is effective against.mineableBlocksTag(blockTag: TagKey<Block>)
: Set the mineable block tag to.knife()tfc:mineable_with_knifeand add the tool to thetfc:tools/knifetag
Example
StartupEvents.registry('item', event => {
event.create('tool', 'tfc:tool')
.mineableBlocksTag('kubejs:ugly_blocks')
.attackDamageBaseline(0.2)
.modifyTier(tier => {
tier.setUses(5000)
})
})
Windmill Blade
Type: tfc:windmill_blade
Creates a new windmill blade item
Inherits the methods of the default item builder
Extra Methods
: Set the blade color, defaults to.bladeColor(color: @Nullable KubeColor)0xFFFFFF. Translucency is not supported
: Set the texture of the blade. Defaults to.bladeTexture(texture: ResourceLocation)tfc:entity/misc/windmill_blade
Example
StartupEvents.registry('item', event => {
event.create('windmill', 'tfc:windmill_blade')
.bladeColor(0x45F977)
})
Precision Prospecting Prospector
Type: precisionprospecting:prospector
Creates a new prospector item
Inherits the methods of the chisel item builder
Extra Methods
: Set the radii, displacement, and prospect tag of the prospector based on a preset. Accepts.builtinType(type: ProspectorType)pros_hammer,pros_drill, ormin_pros
: Set the integer level of the prospector, determines the chance the prospector reports a false negative. The chance is calculated from the level as.level(level: int)0.3 - level * (0.3 / 5)wherelevelis clamped to the range[0, 5]
: Set the tag the prospector will scan for.prospectTag(tag: TagKey<Block>)
: Set the cool down of the prospector.coolDown(c: int)
: Set the primary scanning radius of the prospector, defaults to.primaryRadius(radius: int)12
: Set the primary scanning radius of the prospector as a supplier, defaults to.primaryRadiusSupplier(radius: Supplier<int>)() => 12
: Set the secondary scanning radius of the prospector, defaults to.secondaryRadius(radius: int)12
: Set the secondary scanning radius of the prospector as a supplier, defaults to.secondaryRadiusSupplier(radius: Supplier<int>)() => 12
: Set the scanning displacement of the prospector, defaults to.displacement(displacement: int)0
: Set the scanning displacement of the prospector as a supplier, defaults to.displacementSupplier(displacement: Supplier<int>)() => 0
Example
StartupEvents.registry('item', event => {
event.create('clay_sniffer', 'precisionprospecting:prospector')
.level(5)
.prospectTag('kubejs:prospectable_clay')
.primaryRadius(20)
.secondaryRadius(4)
})