Magical Scepter

Spell Definition

Spells are stored as JSON files within a data pack in the path data/<namespace>/magicalscepter/spell.

  • {}: Root object.
    • []{} casts: Cast components.
      • []{} effects: Effect components - Controls the effect of the spell.
        • "" type: Effect type specified by id.
        • + Additional fields based on effect type.
      • []{} transformers: Transformer components - Controls the context of the spell.
        • "" type: Transformer type specified by id.
        • + Additional fields based on transformer type.
    • I cooldown: Non negative integer - Duration of casting cooldown in ticks afterthe spell is cast.
    • @ description: Text component - Tooltip description for the spell.
Example JSON
{
"casts": [
{
"effects": [
{
"type": "magicalscepter:play_sound",
...
}
]
},
{
"effects": [
{
"type": "magicalscepter:summon_entity",
...
}
],
"transformers": [
{
"type": "magicalscepter:move",
...
}
]
}
],
"cooldown": 100,
"description": {
"translate": "spell.magicalscepter.dragon_fireball"
}
}

Effect

Play Sound

Play a sound like the vanilla enchantment effect play sound.

  • {}: Root object.
    • ""{} sound: Sound to play.
    • F volume: Volume to to play the sound with.
    • F pitch: Pitch to to play the sound with.
Example JSON
{
"type": "magicalscepter:play_sound",
"pitch": {
"type": "minecraft:uniform",
"max_exclusive": 1.2,
"min_inclusive": 0.8
},
"sound": "minecraft:entity.warden.sonic_boom",
"volume": 1.0
}

Spawn Particles

Spawn particles like the vanilla enchantment effect spawn particles.

  • {}: Root object.
    • {} particle: Particle to spawn.
    • {} delta: Direction to move particle towards.
    • F speed: Particle speed to mutiply direction with.
Example JSON
{
"type": "magicalscepter:spawn_particles",
"particle": {
"type": "minecraft:dragon_breath"
},
"delta": [0.0, 2.0, 1.0],
"speed": 1.8
}

Apply Mob Effect

Apply mob effect like the vanilla enchantment effect apply mob effect.

  • {}: Root object.
    • []"" to_apply: Any number of effects.
    • F duration: Duration of effect in seconds.
    • F amplifier: Amplifier of effect.
Example JSON
{
"type": "magicalscepter:apply_mob_effect",
"to_apply": "minecraft:haste"
"duration": {
"type": "minecraft:uniform",
"max_exclusive": 25.0,
"min_inclusive": 20.0
},
"amplifier": 1.0,
}

Remove Mob Effect

Remove any mob effect from the current target.

  • {}: Root object.
    • []"" to_apply: Any number of effects to remove.
Example JSON
{
"type": "magicalscepter:remove_mob_effect",
"to_apply": "minecraft:haste"
}

Summon Entity

Summon an entity like the vanilla enchantment effect spawn entity.

  • {}: Root object.
    • []"" entity: Any number of entity types to spawn.
    • []{} effects: List of spell effects to apply to the spawned entity.
    • {} nbt: Nbt data to spawn entities with.
Example JSON
{
"type": "magicalscepter:summon_entity",
"effects": [],
"entity": "minecraft:evoker_fangs"
}

Teleport

Teleport the target to the location.

Example JSON
{
"type": "magicalscepter:teleport"
}

Damage

Damage the target like the vanilla enchantment effect damage entity.

  • {}: Root object.
    • F amount: Amount of damage to apply.
    • "" damage_type: Damage type to apply damage with.
Example JSON
{
"type": "magicalscepter:damage",
"amount": {
"type": "minecraft:uniform",
"max_exclusive": 6.0,
"min_inclusive": 4.0
},
"damage_type": "minecraft:indirect_magic"
}

Move

Move the target in the direction of the rotation.

  • {}: Root object.
    • F power: Power to move the target with.
    • B knockback: Whether the force is applied as knockback.
Example JSON
{
"type": "magicalscepter:move",
"knockback": true,
"power": 0.5
}

Rotate

Rotate the target to the rotation.

Example JSON
{
"type": "magicalscepter:rotate"
}

Ignite

Ignite the target like the vanilla enchantment effect ignite.

  • {}: Root object.
    • F duration: Duration to set the target on fire for in seconds.
Example JSON
{
"type": "magicalscepter:ignite",
"duration": 1.5,
}

Explode

Cause an explosion like the vanilla enchantment effect explode.

  • {}: Root object.
    • B attribute_to_caster: Whether the explosion should be attributed to the spell caster.
    • "" damage_type: Damage type the explosion should have.
    • F knockback_multiplier: Multiplies the amount of knockback the explosion should have.
    • []"" immune_blocks: List of blocks that should be immune to the explosion.
    • F radius: Radius the explosion should have.
    • B create_fire: Whether the explosion should cause fire.
    • "" block_interaction: How the explosion should interact with surrounding blocks.
    • {} particle: Particle the explosion should spawn.
    • ""{} sound: Sound the explosion should play.
Example JSON
{
"type": "magicalscepter:explode",
"damage_type": "minecraft:indirect_magic",
"radius": 1.5,
"block_interaction": "block",
"particle": {
"type": "minecraft:explosion"
},
"sound": "entity.generic.explode"
}

Replace Block

Replace a block like the vanilla enchantment effect replace block.

  • {}: Root object.
    • {} block_state: Block state to set the block to.
Example JSON
{
"type": "magicalscepter:replace_block",
"block_state": {
"simple_state_provider": {
"state": {
"Name": "dirt"
}
}
}
}

Run Function

Run a function like the vanilla enchantment effect run function.

  • {}: Root object.
    • "" function: Function to run.
Example JSON
{
"type": "magicalscepter:run_function",
"function": "magicalscepter:sayhi"
}

Transformer

Anchor

Anchors the context in time, which allows a transformer that delays to invoke effects at a fixed context.

Example JSON
{
"type": "magicalscepter:anchor"
}

Line

Splits the cast into multiple positions on a line.

  • {}: Root object.
    • {} position: Position at the end of the line to create.
    • I amount: Amount of casts to create on the line.
    • F step_delay: Time between casts on the line in ticks.
Example JSON
{
"type": "magicalscepter:line",
"amount": 16,
"position": {
"type": "magicalscepter:relative",
"x": 0.0,
"y": 0.0,
"z": 20.0
},
"step_delay": 1.0
}

Circle

Splits the cast into multiple positions on a circle.

  • {}: Root object.
    • {} position: Position at the start of the circle.
    • F direction: Direction to circle the start position around the context position.
    • F arc: Arc degrees to create casts onto a section of the circle, by default 360.
    • I amount: Amount of casts to create on the circle.
    • F step_delay: Time between casts on the circle in ticks.
Example JSON
{
"type": "magicalscepter:circle",
"amount": 5,
"position": {
"type": "magicalscepter:relative",
"x": 0.0,
"y": 0.0,
"z": 1.5
}
}

Surface

Relocate the cast vertically to a nearby surface.

  • {}: Root object.
    • F distance: Vertical distance to find valid surface for.
    • B require: Whether to cancel or keep current cast on failure.
    • {} position: Optional position to increase search range above or below context position.
Example JSON
{
"type": "magicalscepter:surface",
"distance": 8.0
}

Move

Move the cast to a specified position.

  • {}: Root object.
    • {} position: Position to move cast to.
Example JSON
{
"type": "magicalscepter:move",
"position": {
"type": "magicalscepter:random",
"dx": 8.0,
"dy": 4.0,
"dz": 8.0
}
}

Rotate

Rotate the cast to a specified rotation.

  • {}: Root object.
    • {} rotation: Rotation to rotate cast to.
Example JSON
{
"type": "magicalscepter:rotate",
"rotation": {
"type": "magicalscepter:random",
"pitch": 0.0,
"yaw": 12.0
}
}

Delay

Delay the cast with a specified delay.

  • {}: Root object.
    • I delay: Time to delay the cast with in ticks.
Example JSON
{
"type": "magicalscepter:delay",
"delay": 4
}

Repeat

Repeat the cast multiple times.

  • {}: Root object.
    • I amount: Amount of casts to create.
    • I step_delay: Time to delay between the casts in ticks.
Example JSON
{
"type": "magicalscepter:repeat",
"amount": 8,
"delay": 2
}

Ray

Check a ray to change context to first hit block or entity.

  • {}: Root object.
    • "" target: Ray target, either block or entity.
    • D range: Range of the ray to cast.
    • B require: Whether to cancel or keep current cast on failure.
Example JSON
{
"type": "magicalscepter:ray",
"range": 24.0,
"target": "entity"
}

Filter

Cancel the cast based on predicate.

  • {}: Root object.
    • {} filters: Predicate to check.
Example JSON
{
"type": "magicalscepter:filter",
"filters": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_on_ground": false
}
}
}
]
}