Code Monkey home page Code Monkey logo

ouch's Introduction

Ouch!

Tired of guessing how much damage entity you attacked took? Or maybe you just wanted to make fights look bit fancier? Then this mod is for you!

Ouch! is Fabric (and Quilt) server side modification powered by Polymer which adds number/text particle effect activated after entity getting damaged, dying or getting healed (by default only damage/healing is visible)! This mod is also fully configurable allowing to change the text (color and display), size, movement and visibility time, depending on predicates testing for damage type, victim (damaged entity), source (attacker or projectile) and attacker (attacker). It can also display multiple particles with different setting for same damage, allowing for extra fun messages and alike.

Configuration.

This mod config file is stored as ./config/ouch.json. All custom text within it uses the QuickText format. All predicates use are supplied by Predicate API, using this format. Lines prefixed with // aren't part of real config and are here just to explain it.

{
  // All display values for damage.
  "damage": [
    // Top layer array defines lists in which text/settings will be found.
    // Only single definition from each included array is used. They are matched from top to bottom.
    [
      // Text/Display definition.
      {
        // [Optional] Matches damage by type, being either a single entry ("minecraft:generic")
        // a tag ("#minecraft:is_fire") or list of entries (["minecraft:mob_attack", "minecraft:player_attack"])
        // By default (not set), it matches everything.
        "type": "...",
        // [Optional] Predicate checking for victim (damaged entity).
        // By default, always succeeds.
        "victim": {
          "type": "..."
        },
        // [Optional] Predicate checking for attacker (entity which attacked entity).
        // By default, always succeeds.
        "attacker": {
          "type": "..."
        },
        // [Optional] Predicate checking for source (projectile or attacker).
        // By default, always succeeds.
        "source": {
          "type": "..."
        },
        // [Optional] A floating point number from 0 to 1 (inclusive) describing change
        // this message is selected. 1 means it's always selected if other properties match,
        // 0.5 is 50% and 0 is never.
        // By default, it's set to 1.
        "chance": 1,
        // [Optional] Sets value velocity of particle is multiplied by every tick.
        // It needs to be a number between 0 and 1
        // Default value: 0.7
        "per_tick_velocity_multiplier": 0.7,
        // [Optional] Sets value of (downwards) gravity particle is effected by.
        // It needs to be a number between -1 and 1
        // Default value: 0.05
        "gravity": 0.05,
        // [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
        // visible for. It needs to be a number larger than 0.
        // Default value: 20
        "staying_time": 20,
        // [Optional] Sets the scale/size of the particle.
        // It needs to be a number between 0 and 5
        // Default value: 0.8
        "text_scale": 0.8,
        // [Optional] Overrides calculated velocity with a static one.
        // Default value: not set / uses calculated one.
        "velocity_override": [0, 2, 0],
        // Text used for damage particle. Has placeholders:
        // ${value} - shows rounded damage with 1 number as decimal part.
        // ${value_rounded} - shows rounded damage rounded to integer.
        // ${value_raw} - shows raw damage value.
        "text": "<red>-${value}"
      }
    ]
  ],
  // All display values for death text.
  "death": [
    // Top layer array defines lists in which text/settings will be found.
    // Only single definition from each included array is used. They are matched from top to bottom.
    [
      // Text/Display definition.
      {
        // [Optional] Matches damage by type, being either a single entry ("minecraft:generic")
        // a tag ("#minecraft:is_fire") or list of entries (["minecraft:mob_attack", "minecraft:player_attack"])
        // By default (not set), it matches everything.
        "type": "...",
        // [Optional] Predicate checking for victim (damaged entity).
        // By default, always succeeds.
        "victim": {
          "type": "..."
        },
        // [Optional] Predicate checking for attacker (entity which attacked entity).
        // By default, always succeeds.
        "attacker": {
          "type": "..."
        },
        // [Optional] Predicate checking for source (projectile or attacker).
        // By default, always succeeds.
        "source": {
          "type": "..."
        },
        // [Optional] A floating point number from 0 to 1 (inclusive) describing change
        // this message is selected. 1 means it's always selected if other properties match,
        // 0.5 is 50% and 0 is never.
        // By default, it's set to 1.
        "chance": 1,
        // [Optional] Sets value velocity of particle is multiplied by every tick.
        // It needs to be a number between 0 and 1
        // Default value: 0.7
        "per_tick_velocity_multiplier": 0.7,
        // [Optional] Sets value of (downwards) gravity particle is effected by.
        // It needs to be a number between -1 and 1
        // Default value: 0.05
        "gravity": 0.05,
        // [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
        // visible for. It needs to be a number larger than 0.
        // Default value: 20
        "staying_time": 20,
        // [Optional] Sets the scale/size of the particle.
        // It needs to be a number between 0 and 5
        // Default value: 0.8
        "text_scale": 0.8,
        // [Optional] Overrides calculated velocity with a static one.
        // Default value: not set / uses calculated one.
        "velocity_override": [0, 2, 0],
        // Text used for damage particle. Has placeholders:
        // ${message} - death message used.
        // ${victim} - name of the victim.
        // ${attacker} - name of the attacker.
        "text": "<red>${message}"
      }
    ]
  ],
  // All display values for healing.
  "healing": [
    // Top layer array defines lists in which text/settings will be found.
    // Only single definition from each included array is used. They are matched from top to bottom.
    [
      // Text/Display definition.
      {
        // [Optional] Predicate checking for healed entity.
        // By default, always succeeds.
        "entity": {
          "type": "..."
        },
        // [Optional] A floating point number from 0 to 1 (inclusive) describing change
        // this message is selected. 1 means it's always selected if other properties match,
        // 0.5 is 50% and 0 is never.
        // By default, it's set to 1.
        "chance": 1,
        // [Optional] Sets value velocity of particle is multiplied by every tick.
        // It needs to be a number between 0 and 1
        // Default value: 0.7
        "per_tick_velocity_multiplier": 0.7,
        // [Optional] Sets value of (downwards) gravity particle is effected by.
        // It needs to be a number between -1 and 1
        // Default value: 0.05
        "gravity": 0.05,
        // [Optional] Sets the time (in ticks, 20 ticks is a second), the particle is
        // visible for. It needs to be a number larger than 0.
        // Default value: 20
        "staying_time": 20,
        // [Optional] Sets the scale/size of the particle.
        // It needs to be a number between 0 and 5
        // Default value: 0.8
        "text_scale": 0.8,
        // [Optional] Overrides calculated velocity with a static one.
        // Default value: not set / uses calculated one.
        "velocity_override": [0, 2, 0],
        // Text used for healing particle. Has placeholders:
        // ${value} - shows rounded healing amount with 1 number as decimal part.
        // ${value_rounded} - shows healing amount rounded to integer.
        // ${value_raw} - shows raw healing amount value.
        "text": "<green>+${value}"
      }
    ]
  ]
}

ouch's People

Contributors

patbox avatar firstmegagame4 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.