Skip to content
Lyof429 edited this page Mar 8, 2025 · 23 revisions

< Back to homepage


Staffs are a new tiered tool type added to the game. They serve as a middle ground between full on melee (swords) and ranged (bows and crossbows) combat, by shooting an instantaneous, gravityless ray inflicting magic damage.

They have a limited range and the higher tier ones can pierce through multiple foes, but go on a cooldown after they are used.

Depending on the configuration used, staffs can be set to require and use experience when shot. This can be enabled on a per staff basis or for all of them.

Sortilege adds several enchantments that can be applied to staffs. Look at this page to learn more.

Configuration

1. Config file

With the default configs, you will have access to staffs made of wood, stone, iron, gold, diamond and netherite. You can add or remove any staff by using the configuration file, with this format (such an object must be added to the "entries" option):

{
  // Main key of the staff. Will be used as its item id in game
  // Must be a valid minecraft id (only lowercase letters and _). Be wary of duplicate entries
  "example_staff": {
    // Sets the repair material and the durability if not set
    // Must be one of WOOD, STONE, IRON, GOLD, DIAMOND, NETHERITE
    "tier": "GOLD",
    // Staff's enchantability on the Enchanting Table. Defaults to the tier's
    "enchantability": 22,
    // Half hearts of damage the staff deals
    "damage": 5,
    // Maximal number of targets the staff can pierce through
    "pierce": 2,
    // Range of the staff, in half blocks
    "range": 10,
    // Durability of the staff. Defaults to tier's
    "durability": 512,
    // Item to be used to repair the staff. Defaults to the tier's
    "repair_item": "minecraft:obsidian",
    // Amount of ticks to wait for between each shots
    "cooldown": 20,
    // Amount of ticks of casting to shoot. Defaults to default_charge_time
    "charge_time": 1,
    // Amount of xp points needed to shoot. Defaults to default_xp_cost
    "xp_cost": 0,
    // Custom RGB colors to be used for the staff's beam. If unset, the beam will be white unless the staff has enchantments
    // Must be a list of triples, with values ranging from 0 to 1
    "beam_color": [
      [0.5, 0, 0],
      [0, 0.5, 0],
      [0, 0, 0.5]
    ],
    // Whether the staff is resistant to fire like Netherite items. Defaults to false
    "fire_res": true,
    // Mod needed to be loaded for the staff to appear in game. Defaults to minecraft
    "dependency": "nah",
    // Commands to be run when using the staff
    "on_shoot": "/give @s minecraft:lapis_lazuli",
    "on_hit_self": "/effect give @s minecraft:regeneration",
    "on_hit_target": "/tp @s ~ ~2 ~"
  }
}

This allows you to add, edit or remove any staffs you want. Staffs will be added to creative tabs in the same order they are put in this list. Please feel absolutely free to obliterate the default staffs to make your own. They are how I personally play, but I am aware some people would want staffs made of amethyst, lapis and emerald, for instance.

All the entries are optional, and have a default value if they are not set.

"on_shoot" is called when the staff is used, no matter if it hits or not "on_hit_self" is called everytime an entity is hit, from the user "on_hit_target" is called everytime an entity is hit, from the hit entity


Here is an example of staff.entries keeping the netherite staff, changing the color of the diamond one to be blue, and adding one made of amethyst:

"entries": [
  {
    "amethyst_staff": {
      "tier": "IRON",
      "damage": 5,
      "pierce": 2,
      "range": 10,
      "cooldown": 20
    }
  },
  {
    "diamond_staff": {
      "tier": "DIAMOND",
      "damage": 5,
      "pierce": 2,
      "range": 12,
      "cooldown": 15,
      "beam_color": [
        [0.5, 0.5, 1]
      ],
    }
  },
  {
    "netherite_staff": {
      "tier": "NETHERITE",
      "damage": 6,
      "pierce": 3,
      "range": 16,
      "fire_resistant": true,
      "cooldown": 20
    }
  }
]

2. Assets

You need to add all assets for the staffs you add yourself. This is slightly annoying, but it gives you full power over what your staffs look like and how they behave.


Here is an example to add a basic texture and model to a staff with id example_staff. Create a new resource pack, and then add the following files at the specified locations:

assets/sortilege/textures/item/example_staff.png

Here goes the texture for your staff. It can be any size you want, but should stay a power of 2. Minecraft uses 16x16 for its textures, so I recommend using the same size.

You are allowed to take the texture of one of the base staffs and edit it, including in a public modpack, as long as you do not claim the texture your own.

assets/sortilege/models/item/example_staff.json

Here goes the item model. The following will make it look the same way as the default staffs:

{
  "parent": "item/handheld",
  "textures": {
    "layer0": "sortilege:item/example_staff"
  }
}

3. Data

This is required only if you want to make your staff obtainable in survival. Any implementation goes, so do whatever you prefer for this one. Here is a basic recipe like the ones used by the default staffs, with obsidian as the material.

data/sortilege/recipes/example_staff.json

{
  "type": "minecraft:crafting_shaped",
  "group": "staff/example",
  "pattern": [
    " SM",
    " SS",
    "M  "
  ],
  "key": {
    "M": {
      "item": "minecraft:obsidian"
    },
    "S": {
      "item": "minecraft:stick"
    }
  },
  "result": {
    "item": "sortilege:example_staff"
  }
}

Clone this wiki locally