Skip to content

Creating Shard Types

Skye Prince edited this page Apr 26, 2024 · 3 revisions

In Scattered Shards 1.5 and higher, you need to create your own shard types before using the mod.

JSON Format

Shard types are stored under the shard_type folder of a namespaced data pack. You can bundle multiple shard types in a single JSON file. The format for a single shard type object is as follows:

  • text_color (string): The text color used in the Shard Creator and Shard Tablet GUIs. Formatted as a hex code with a leading # symbol.
  • glow_color (string): The color of the glow-halo texture around shard blocks in-game. Formatted the same as text_color.
  • collect_particle (string): A resource location of the particle type to spawn when a player collects a shard of this type.
  • collect_sound (object): The sound event to play when a player collects a shard of this type.
  • list_order (int): Ascending ordinal to use when ordering multiple shard types in a Shard Tablet row.

Then, in a single file, map resource locations of shard types to their corresponding objects in the format above.

Example

{
  "testpack:my_shard_type": {
    "text_color": "#abc123",
    "glow_color": "#000FFF",
    "collect_particle": "minecraft:glow",
    "collect_sound": {
      "sound_id": "minecraft:entity.llama.swag"
    },
    "list_order": 1
  }
}

Textures

Once you've created the shard types, you then need to give them shard textures. These textures are stored under the textures/gui/shards folder of a resource pack using the same namespace as the shard types.

Each shard type requires four textures:

  • A front texture, 24x32 (<type_name>_front.png)
  • A backing texture, 24x32 (<type_name>_backing.png)
  • A mini front texture, 12x16 (<type_name>_mini_front.png)
  • A mini backing texture, 12x16 (<type_name>_mini_backing.png)

Note: <type_name> in this case refers to the shard type path, e.g. my_shard_type in the previous example.

The larger front and backing textures are displayed on shard blocks in-game and in the right GUI panels. The mini textures are used for the Shard Tablet selection buttons (front for collected, backing otherwise). Both front textures should include some space in the top half for shard icons.

Localization

For each shard type, add a translation key in the following format: shard_type.<namespace>.<type_name>.description. Once again using the previous example:

{
  "shard_type.testpack.my_shard_type.description": "My Shard Type"
}

Sounds

Scattered Shards comes bundles with three shard collection sounds for use in shard types. They are as follows:

  • scattered_shards:collect_visitor: A low-level collection sound for obvious shards.
  • scattered_shards:collect_challenge: A sound with a little more flair for challenging shards.
  • scattered_shards:collect_secret: A drawn-out "mission complete" sound for very well-hidden shards.

Further Examples

Clone this wiki locally