Systems

Block-Break Spawns

Breaking a matching block may turn it into a creature - for example a harvested pumpkin that becomes an evil pumpkin during Halloween. Rules are data in config/blockbreakspawns/*.json.


Configuration

{
  "rules": [
    {
      "id": "halloween-evilpumpkin",
      "eventId": "halloween",
      "blockCodes": ["game:pumpkin-fruit-4"],
      "chance": 0.09,
      "entityCode": "alegacyevents:evilpumpkin",
      "cancelDrops": true,
      "sound": "alegacyevents:sounds/creature/evilpumpkin/spawn",
      "messageLangKey": "alegacyevents:evilpumpkin-spawned"
    }
  ]
}
FieldDefaultDescription
idnoneName used in log warnings
eventIdnoneOnly while this seasonal event is active
blockCodesrequiredBlock codes, wildcards allowed
entityCoderequiredCreature to spawn
chance0.05Chance per broken block
cancelDropstrueThe block drops nothing - it "became" the creature
soundnoneSound played at the block (16 block range)
messageLangKeynoneLang key of a chat message sent to the player who broke the block

Notes:

  • Rules are checked in file order and the first one that matches the block and passes its chance roll wins. Put rare rules first: in the Halloween pack the rarer king (2.5%) comes before the common evil pumpkin (9%).
  • The creature appears at the block center, turned toward the player.
  • Only breaking by a player counts; rules with a missing entityCode or empty blockCodes are ignored.

Press ESC to close