Health, shield and regeneration. - korbynullevig/craftmoto GitHub Wiki

Health module is a really quick module even we can think it can take many time. Helmet and add-ons can be used both and together, every case will be explained. you can't put damage redutions, it's all or nothing.

  • <int> Is a number, as 1, 10, 6487 . Don't put negative value if it isn't writed. X.0 isn't a int.

  • <double> Is a decimal number, as 0.7 or 0.0 . Don't put negative value if it isn't writed. Int can be used too.

  • Here is an example from the template.yml

## Damage sources that this add-on is invulnerable to. This will make the vehicle resistant to all damage of these types.
invulnerable:
  inFire: false
  lightningBolt: false
  onFire: false
  lava: false
  hotFloor: false
  inWall: false
  cramming: false
  drown: false
  cactus: false
  fall: false
  flyIntoWall: false
  generic: false
  magic: false
  wither: false
  anvil: false
  fallingBlock: false
  dragonBreath: false
  fireworks: false
  mob: false
  player: false
  arrow: false
  thrown: false
  indirectMagic: false
  thorns: false
  explosion: false

## The helmet add-on will take damage from all damage sources unless shielded by other accessory add-ons.
## Add-ons will take damage evenly until breaking, then the add-on will be removed from the vehicle.
shield:
  health: 20 ## The health of this add-on.
  regen_speed: 0.01 ## How fast (in half-hearts per tick) this add-on regenerates health.
  from: ## Damage sources this add-on shields from (unless add-on type is helmet).
    inFire: false
    lightningBolt: false
    onFire: false
    lava: false
    hotFloor: false
    inWall: false
    cramming: false
    drown: false
    cactus: false
    fall: false
    flyIntoWall: false
    generic: false
    magic: false
    wither: false
    anvil: false
    fallingBlock: false
    dragonBreath: false
    fireworks: false
    mob: false
    player: false
    arrow: false
    thrown: false
    indirectMagic: false
    thorns: false
    explosion: false

SET UP VEHICLE IMMUNE TO: (Optional)

invulnerable:
  inFire: <true/false>
  lightningBolt: <true/false>
  onFire: <true/false>
  lava: <true/false>
  hotFloor: <true/false>
  inWall: <true/false>
  cramming: <true/false>
  drown: <true/false>
  cactus: <true/false>
  fall: <true/false>
  flyIntoWall: <true/false>
  generic: <true/false>
  magic: <true/false>
  wither: <true/false>
  anvil: <true/false>
  fallingBlock: <true/false>
  dragonBreath: <true/false>
  fireworks: <true/false>
  mob: <true/false>
  player: <true/false>
  arrow: <true/false>
  thrown: <true/false>
  indirectMagic: <true/false>
  thorns: <true/false>
  explosion: <true/false>
  • Each line is optional, whether or not if the vehicle is immune to these damage source. If an add-on is added to the helmet, the true and false multiply themselve like this:
  1. True x True = True
  2. False x False = True
  3. True x False = False

SET UP SHIELD AND REGENERATION

shield:
  health: <int>
  regen_speed: <double>
  from: 
    inFire: <true/false>
    lightningBolt: <true/false>
    onFire: <true/false>
    lava: <true/false>
    hotFloor: <true/false>
    inWall: <true/false>
    cramming: <true/false>
    drown: <true/false>
    cactus: <true/false>
    fall: <true/false>
    flyIntoWall: <true/false>
    generic: <true/false>
    magic: <true/false>
    wither: <true/false>
    anvil: <true/false>
    fallingBlock: <true/false>
    dragonBreath: <true/false>
    fireworks: <true/false>
    mob: <true/false>
    player: <true/false>
    arrow: <true/false>
    thrown: <true/false>
    indirectMagic: <true/false>
    thorns: <true/false>
    explosion: <true/false>
  • health: <int>is the number of max health point of the helmet / add-on. An add-on doesn't increase the vehicle max health when added into him, this health is for the add-on heath which can break. (1 heart = 2HP)
  • regen_speed: <double> Regeneration in percent per ticks. (20 ticks = 1 second).
  • from: (and under) are optional, that's define from which damage source this vehicle can regenerate. Per default, vehicle will regen of everything. Only add-ons are used for this.
⚠️ **GitHub.com Fallback** ⚠️