Skip to content
Luke100000 edited this page Oct 16, 2021 · 2 revisions

Gifts

Gifts are defined via gift types. Each gift type contains a list of ids or tags (prefixed with a hashtag) with a base value.

Then it contains a list of conditions that can increase or decrease this base value. The final value affects both hearts and mood change by a factor chosen in the config (default 0.25).

Optionally, custom answer dialogues can be defined for fail, good, better, and best.

Also optionally, the respective thresholds (default 0, 10, and 20) can be overwritten.

If several gift types match, the worst failing type is chosen, or, if all succeeded, the best one is chosen.

Files located in common\src\main\resources\data\mca\gifts

Example file:

{
  "conditions": [
    {
      "profession": "mca:warrior",
      "min_health": 10,
      "mood": 20
    }
  ],
  "thresholds": {
    "fail": 0,
    "good": 10,
    "better": 20,
  },
  "responses": {
    "fail": "gift.fail",
    "good": "gift.good",
    "better": "gift.better",
    "best": "gift.best"
  },
  "items": {
    "minecraft:netherite_axe": 30,
    "#minecraft:planks": 1
  }
}

Conditions

Here is the list of available conditions

  • profession, string
  • age_group, ("BABY", "TODDLER", "CHILD", "TEEN", "ADULT")
  • gender, ("MALE", "FEMALE")
  • has_item, Ingredient
  • min_health, float
  • is_married, boolean
  • has_home, boolean
  • has_village, boolean
  • min_infection_progress, float
  • mood, Mood
  • mood_group, MoodGroup
  • personality, Personality
  • is_pregnant, boolean
  • min_pregnancy_progress, int
  • pregnancy_child_gender, ("MALE", "FEMALE")
  • current_chore, string
  • item, Ingredient
  • tag, string
  • trait, string

Tags

When to use tags? Always then, when you do not refer to one specific item but to a type. E.g. for allergies.

The second use case is mass items, where all satisfaction values are the same anyways. Better to extend by resource packs btw.

Clone this wiki locally