How to make a Damage Type

Section

What is a damage type?

Damage types define custom properties for damage in the game, offering greater flexibility in how damage affects entities. These properties include:

  • Exhaustion Effects: Custom levels of exhaustion applied when damage is taken.
  • Damage Sounds: Unique sounds triggered upon taking damage.
  • Scaling with Entity: Control over whether the damage scales based on the entity's attributes.

Additionally, damage types support custom death messages, allowing personalized notifications in chat when an entity dies, enhancing gameplay feedback and immersion.

Create the element

  • Click the "Mod elements" tab.
  • Click the green "plus" button.
  • Select "Damage type"
  • Give the mod element a name.
  • Click the "Create new Damage type" button.

Damage properties

Exhaustion amount:
  • This will add exhoustion to the player which will make the player lose hunger.
  • Higher numbers will decrease the hunger bar faster.
Does damage scale with difficulty?
  • This setting allows you to make the damage type scale with difficulty.
    • never will make it not scale with difficulty.
    • always will make it scale with difficulty.
    • when_caused_by_living_non_player will scale with difficulty when it is applied from an entity but not from players.
Damage sound effect:
  • The sound that plays when the entity takes damage.
  • Sound options:
    • hurt
    • thorns
    • drowning
    • burning
    • poking
    • freezing

Death messages

Normal death message: The message that is displayed when the entity dies without another entity hurting it.
Item death message: The message that is displayed when another entity kills this entity with an item.
Assisted death message: The messages that is displayed when an entity is killed by another entity.

Text variables

Using specific formatting can get specific data for the entity. These variables are dependent on the type of message, meaning that testing for an item may not work in other death message fields.

  • <player> - Gets the entity that died.
  • <attacker> - Gets the entity that killed the entity that died.
  • <item> - Gets an item that was used to kill the entity.

Applying damage

Despite the name, Damage Types do not directly control the amount of damage dealt. Instead, damage is applied through procedures, giving you greater flexibility in determining when and how much damage should be inflicted. This system allows for more customized and dynamic damage handling, letting you tailor damage based on specific conditions or events within the game.

After creating a custom Damage Type, it becomes available in the Damage Procedures tab within the procedure editor. From here, you can incorporate your damage type into various procedures, allowing you to fine-tune how and when it’s applied during gameplay.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.