Customizing Resonance Drops - DaFuqs/Spectrum GitHub Wiki

Resonance is an enchantment valid for mining tools, which unlocks in the late game tree. Resonance allows modifying block drops by an extendable variety of ways. Spectrum ships with 2 types of resonance drop modificators:

  • spectrum:drop_self: Allows silk-touch like behavior with the ability to copy block entity or block state data
  • spectrum:modify_drops: Allows the conversion of drops to a whole other item type

You can specify resonance drop modifications by placing json files in the directory <data_pack_or_mod_name>/resonance_drops/. Mods are able to add their own processors by calling ResonanceDropProcessors.register().

spectrum:drop_self: Highly configurable Silk Touch

Making the block drop itself - even ones that can not be harvested via Silk Touch. You can also specify to copy block entity or block state data.

Properties

  • (BlockPredicate) block: The block / blocks / block tag that this entry triggers on
  • (String[]) nbt_to_copy: Block Entity NBT to preserve
  • (String[]) state_properties_to_copy: Block State Properties to preserve
  • (Boolean) include_default_state_properties: Normally, state properties that are the default will be omitted to make items stack better. By setting this flag to true, those will be copied regardless. (like persistent=false for leaves)

Example: Making Blocks drop themselves

{
  "type": "spectrum:drop_self",
  "block": {
    "blocks": [
      "spectrum:black_materia"
    ]
  }
}
{
  "type": "spectrum:drop_self",
  "block": {
    "tag": "c:buds"
  }
}

Example 2: Preserving Block State Properties

When a Sculk Shrieker is broken, retain the ability to summon the Warden.

{
  "type": "spectrum:drop_self",
  "block": {
    "blocks": [
      "minecraft:sculk_shrieker"
    ]
  },
  "state_properties_to_copy": [
    "can_summon"
  ]
}

Example 3: Preserving Block Entity Data

When a block in the minecraft:signs tag is broken with Resonance, various kinds of block entity data is preserved.

{
  "type": "spectrum:drop_self",
  "block": {
    "tag": "minecraft:signs"
  },
  "nbt_to_copy": [
    "GlowingText",
    "Color",
    "Text1",
    "Text2",
    "Text3",
    "Text4"
  ]
}

spectrum:modify_drops: Modifying Block Drops

Switching the drops a block / block tag drops.

Properties

  • (BlockPredicate) block: The block / blocks / block tag that this entry triggers on
  • (List) modify_drops:
    • (Ingredient) input: The ingredient that will get matched and turned into output
    • (Identifier) output: The item that will be dropped instead

Example

{
  "type": "spectrum:modify_drops",
  "block": {
    "tag": "c:ores"
  },
  "modify_drops": [
    {
      "input": {
        "item": "minecraft:coal"
      },
      "output": "spectrum:pure_coal"
    },
    {
      "input": {
        "tag": "c:raw_coppers"
      },
      "output": "spectrum:pure_copper"
    }
  ]
}