Class path: mods.botanypots.Fertilizer

To use, import the class with import mods.botanypots.Fertilizer; at the beginning of your script.

Creating Fertilizers

Link to creating-fertilizers

Fertilizer.create(id, ingredient, minTick, maxTick);

  • id <string> The id of the new fertilizer. This is a namespaced id an must be in the valid namespace:path format.
  • ingredient <IIngredient> The item used for the fertilizer.
  • minTick <int> The minimum amount of ticks added by the fertilizer.
  • maxTick <int> The maximum amount of ticks added by the fertilizer.

Creates a new fertilizer. These can be used to grow crops faster.

ZenScript
Copy
Fertilizer.create("examplepack:stick", <item:minecraft:stick>, 250, 550);

Removing Fertilizers

Link to removing-fertilizers

Fertilizer.remove(id);

  • id <string> The id of the fertilizer. This is a namespaced id an must be in the valid namespace:path format.

This can be used to remove a fertilizer.

ZenScript
Copy
Fertilizer.remove("botanypots:fertilizers/bone_meal");

Changing Fertilizer Ticks

Link to changing-fertilizer-ticks

Fertilizer.setTicks(String id, int minTick, int maxTick);

  • id <string> The id of the fertilizer. This is a namespaced id an must be in the valid namespace:path format.
  • minTick <int> The new minimum amount of ticks added by the fertilizer.
  • maxTick <int> The new maximum amount of ticks added by the fertilizer.

This will change the growth tick range added by the fertilizer.

ZenScript
Copy
Fertilizer.setTicks("botanypots:fertilizers/bone_meal", 800, 900);

Changing Fertilizer Ingredients

Link to changing-fertilizer-ingredients

Fertilizer.setIngredient(id, ingredient);

  • id <string> The id of the fertilizer. This is a namespaced id an must be in the valid namespace:path format.
  • ingredient <IIngredient> The new item to be used for the fertilizer.

Sets the ingredient item that is the fertilizer.

ZenScript
Copy
Fertilizer.setIngredient("botanypots:fertilizers/bone_meal", <item:minecraft:sugar>);

Fertilizer.getAllIds();

  • Returns: <string[]> An array of all known fertilizer ids at the time this is ran.

This will give you an array of all the known fertilizer ids at the time.

ZenScript
Copy
// Log all ids to the crafttweaker.log file
for fertilizerId in Fertilizer.getAllIds() {
    println(fertilizerId);
}

Removing All Fertilizers

Link to removing-all-fertilizers

This will completely remove all the fertilizers currently registered. This is useful for if you want to recreate all the data from scratch through scripts.

ZenScript
Copy
Fertilizer.removeAll();