Entities

If EntityJS is installed, some TFC entity types will be available

Mammal

Creates a new mammal entity type

Inherits the methods of animal builders

Type: tfc:mammal

Extra methods

  • : Sets the default values of the type’s config
    • .gestationDays(i: number): Sets the number of days the mammal will gestate young for
    • .childCount(i: number): Sets the number of children the mammal will have
    • .animalName(name: String): Sets the name of the mammal in the config file
    • .daysToAdult(i: number): Sets the number of days the mammal will take to reach adulthood
    • .uses(i: number): Sets the number of uses the mammal has
    • .maxFamiliarity(d: number): Sets the maximum familiarity, in the range [0, 1], that an adult mammal may be brought up to
    • .eastRottenFood(eats: boolean): Sets if the animal will eat rotten food
  • : Sets the item tag the mammal will consider food
  • : Accepts the registry ids of and sets the sound events the entity uses, attack, and sleep may be null

Example

StartupEvents.registry('entity_type', event => {
    event.create('my_mammal', 'tfc:mammal')
        .foodTag('kubejs:my_very_special_food_type_only_for_my_mammal')
})

Oviparous

Creates a new oviparous entity type

Inherits the methods of animal builders

Type: tfc:oviparous

Extra Methods

  • : If the animal should crow every so often, defaults to false
  • : Sets the message displayed when the animal has a product ready
  • : Sets the default values of the type’s config
    • .hatchDays(i: number): Sets the number of days the animal will take to hatch
    • .animalName(name: String): Sets the name of the animal in the config file
    • .daysToAdult(i: number): Sets the number of days the animal will take to reach adulthood
    • .uses(i: number): Sets the number of uses the animal has
    • .maxFamiliarity(d: number): Sets the maximum familiarity, in the range [0, 1], that an adult animal may be brought up to
    • .eastRottenFood(eats: boolean): Sets if the animal will eat rotten food
  • : Sets the item tag the mammal will consider food
  • .sounds(ambient: String, death: String, hurt: String, step: String, attack: @Nullable String, sleep: @Nullable String): Accepts the registry ids of and sets the sound events the entity uses, attack, and sleep may be null

Example

StartupEvents.registry('entity_type', event => {
    event.create('oviparous_example', 'tfc:oviparous')
        .crows(true)
        .productReadyMessage("Egg's Ready!")
        .configs(config => {
            config.hatchDays(5)
            config.uses(56)
        })
})

Wooly

Creates a new wooly animal entity type

Inherits the methods of animal builders

Type: tfc:wooly_animal

Extra Methods

  • : Sets the default values of the type’s config
    • .ticksToProduce(i: number): Sets the number of ticks the animal will take to create produce
    • .produceFamiliarity(d: number): Sets the familiarity, in the range [0, 1], that is required for the animal to have its product harvested
    • .animalName(name: String): Sets the name of the animal in the config file
    • .daysToAdult(i: number): Sets the number of days the animal will take to reach adulthood
    • .uses(i: number): Sets the number of uses the animal has
    • .maxFamiliarity(d: number): Sets the maximum familiarity, in the range [0, 1], that an adult animal may be brought up to
    • .eastRottenFood(eats: boolean): Sets if the animal will eat rotten food
  • : Sets the item tag the mammal will consider food
  • : Accepts the registry ids of and sets the sound events the entity uses, attack, and sleep may be null

Example

StartupEvents.registry('entity_type', event => {
    event.create('my_wooly_animal', 'tfc:wooly_animal')
        .sounds('kubejs:wooly.ambient', 'kubejs:wooly.death', 'kubejs:wooly.hurt', 'kubejs:wooly.step', null, null)
})

Dairy

Create a new dairy animal entity type

Inherits the methods of animal builders

Type: tfc:dairy_animal

Extra Methods

  • : Sets the default values of the type’s config
    • .ticksToProduce(i: number): Sets the number of ticks the animal will take to create produce
    • .produceFamiliarity(d: number): Sets the familiarity, in the range [0, 1], that is required for the animal to have its product harvested
    • .animalName(name: String): Sets the name of the animal in the config file
    • .daysToAdult(i: number): Sets the number of days the animal will take to reach adulthood
    • .uses(i: number): Sets the number of uses the animal has
    • .maxFamiliarity(d: number): Sets the maximum familiarity, in the range [0, 1], that an adult animal may be brought up to
    • .eastRottenFood(eats: boolean): Sets if the animal will eat rotten food
  • : Sets the item tag the mammal will consider food
  • : Accepts the registry ids of and sets the sound events the entity uses, attack, and sleep may be null

Example

StartupEvents.registry('entity_type', event => {
    event.create('my_dairy_animal', 'tfc:dairy_animal')
        .configs(config => {
            config.eatsRottenFood(true)
            config.daysToAdult(12)
        })
})