Skip to content

Sacrifices

Skyler James edited this page Mar 27, 2022 · 3 revisions

"Sacrifices" are favor events that are triggered when the player kills a specific entity. This can cause the player to gain or lose favor depending on which creatures they kill.

Data

Each sacrifice is defined as a JSON file located at data/[namespace]/deity/sacrifice/[deity_name]/[sacrifice_name].json. The namespace and deity_name indicate which deity will be affected by the sacrifice. The sacrifice_name is not important but must be unique to that deity.

The JSON file can specify:

  • entity (ID): the namespaced ID of the entity. If not defined, the sacrifice will not do anything.
  • favor (number): the amount of favor to add or remove from the player when they kill this entity. Optional. Defaults to 0.
  • maxuses (number): the number of sacrifices to accept before "locking" this sacrifice. Optional. Defaults to 16
  • cooldown (number): the number of ticks before this sacrifice becomes "unlocked" again. Optional. Defaults to 12000
  • function (ID): an MC function to execute when this sacrifice is accepted. Optional.
  • function_text (string): a translation key to use in the tooltip text that describes the function. Optional. Defaults to the text "Something special may happen when you sacrifice this creature"

Example

This sacrifice is located at data/greek/deity/sacrifice/artemis/rabbit.json and adds 2 favor points with greek:artemis every time a rabbit is killed. Because maxuses and cooldown are not defined, the sacrifice will become locked for 12000 ticks after the player kills 16 rabbits.

{
  "entity": "minecraft:rabbit",
  "favor": 2
}

This sacrifice is located at data/greek/deity/sacrifice/zeus/iron_golem.json and will do the following:

  • When the player kills an iron golem:
    • Add 10 favor points to the player for the deity greek:zeus
    • The sacrifice will become "locked" for 5000 ticks after the player kills 2 iron golems.
    • Execute a function at greek:set_storming with tooltip text located in the localization file at perk.function.set_storming
{
  "entity": "minecraft:iron_golem",
  "favor": 10,
  "function": "greek:set_storming",
  "maxuses": 2,
  "cooldown": 5000,
  "function_text": "perk.function.set_storming"
}
Clone this wiki locally