Item with ability: right-click staff

Datapacks

Staff: ball, Lightning Bolt, click teleportLearn more

Fireball, Lightning Bolt, teleport, explosion, jump or effect -- right click, recharged. Select the ability, type, and name of the object — and download the date pack for Minecraft 1.21.9 - 26.3. No mods, no plagins.

My game select version

We'll remember in this browser and set up where your version is available. Open link settings are more important than this choice; the Vicki versions do not change.

Ability

The ghast ball flies towards where you are looking and explodes.

Explosion force

1 - like a ghast ball, 4 - like dynamite.

Cooldown

Name

Item

Date · 1.21.9 - 26.3
Blaze Rod

Fire Orb

The right click is a fireball, reload 3 s

Issue to yourself - by command or function /function wand_fireball:give

/give @s minecraft:carrot_on_a_stick[minecraft:custom_data={wand:"fireball"},minecraft:item_model="minecraft:blaze_rod",minecraft:item_name={"text":"Огненный шар","color":"gold","italic":false},minecraft:unbreakable={},minecraft:enchantment_glint_override=true]
Download datapack
What's inside the archive - 10 files

data/minecraft/tags/function/load.json

Load tag: the game calls these functions when loading the world and after /reload.

{
  "values": [
    "wand_fireball:load"
  ]
}

data/minecraft/tags/function/tick.json

Tick tag: these functions run every tick - 20 times per second.

{
  "values": [
    "wand_fireball:tick"
  ]
}

data/wand_fireball/function/load.mcfunction

When loading the world: counting clicks with a fishing rod and counting reloads.

scoreboard objectives add wand_fireball dummy
scoreboard objectives add wand_fireball_used minecraft.used:minecraft.carrot_on_a_stick
scoreboard objectives add wand_fireball_cd dummy

data/wand_fireball/function/tick.mcfunction

Each tick: cooldown melts, click to ability.

scoreboard players remove @a[scores={wand_fireball_cd=1..}] wand_fireball_cd 1
execute as @a[scores={wand_fireball_used=1..}] at @s run function wand_fireball:use

data/wand_fireball/function/use.mcfunction

Click with a fishing rod: is it our item, is it reloading.

scoreboard players set @s wand_fireball_used 0
execute unless items entity @s weapon.mainhand minecraft:carrot_on_a_stick[minecraft:custom_data~{wand:"fireball"}] unless items entity @s weapon.offhand minecraft:carrot_on_a_stick[minecraft:custom_data~{wand:"fireball"}] run return 0
execute if score @s wand_fireball_cd matches 1.. run return run title @s actionbar {"text":"Перезарядка…","color":"gray"}
scoreboard players set @s wand_fireball_cd 60
playsound minecraft:entity.blaze.shoot player @a ~ ~ ~
function wand_fireball:cast

data/wand_fireball/function/cast.mcfunction

Capability: Fireball.

function wand_fireball:aim
execute anchored eyes positioned ^ ^ ^1.5 summon minecraft:fireball run function wand_fireball:launch

data/wand_fireball/function/aim.mcfunction

The player's gaze is the difference between two points near the eyes, in thousandths of a block.

execute anchored eyes positioned ^ ^ ^ summon minecraft:marker run function wand_fireball:mark {n:0}
execute anchored eyes positioned ^ ^ ^1 summon minecraft:marker run function wand_fireball:mark {n:1}
scoreboard players operation #dx wand_fireball = #x1 wand_fireball
scoreboard players operation #dy wand_fireball = #y1 wand_fireball
scoreboard players operation #dz wand_fireball = #z1 wand_fireball
scoreboard players operation #dx wand_fireball -= #x0 wand_fireball
scoreboard players operation #dy wand_fireball -= #y0 wand_fireball
scoreboard players operation #dz wand_fireball -= #z0 wand_fireball

data/wand_fireball/function/mark.mcfunction

Macro: marker coordinates count, remove marker.

$execute store result score #x$(n) wand_fireball run data get entity @s Pos[0] 1000
$execute store result score #y$(n) wand_fireball run data get entity @s Pos[1] 1000
$execute store result score #z$(n) wand_fireball run data get entity @s Pos[2] 1000
kill @s

data/wand_fireball/function/launch.mcfunction

The projectile flies at the sight.

execute store result entity @s Motion[0] double 0.001 run scoreboard players get #dx wand_fireball
execute store result entity @s Motion[1] double 0.001 run scoreboard players get #dy wand_fireball
execute store result entity @s Motion[2] double 0.001 run scoreboard players get #dz wand_fireball
data merge entity @s {ExplosionPower:1b,acceleration_power:0.1d}

data/wand_fireball/function/give.mcfunction

♪ Function vand_fireball:give ♪

give @s minecraft:carrot_on_a_stick[minecraft:custom_data={wand:"fireball"},minecraft:item_model="minecraft:blaze_rod",minecraft:item_name={"text":"Огненный шар","color":"gold","italic":false},minecraft:unbreakable={},minecraft:enchantment_glint_override=true]

How to use

  1. Download the datapack

    No need to unpack: the game reads it directly from the zip.

  2. Put it into the world

    In single player - saves/<world>/datapacks, on the server - world/datapacks. Then /reload.

  3. Take the item

    By command /give from the result or /function wand_fireball:give - requires cheats or operator rights.

  4. Click

    Right button in any direction - into the air too. The object can also be in the second hand.

What you need to know

  • Inside is a fishing rod with a carrot. Only her right click is counted in the air, without a block or a mob: the pack recognizes the click based on this count. Type - any game item, component item_model.
  • The staves do not interfere with each other. Each ability has its own namespace (wand_fireball): collect a fire staff and a lightning staff - both packs will stand next to each other.
  • The beam is up to 64 blocks. Lightning Bolt, teleport and explosion hit the first block or mob in the line of sight.
  • Explosion breaks blocksif rule mob_griefing enabled. For spawning and other people's buildings, turn it off or take power 1.

Item with attributes without datapack - attribute generator, its enchantment - The date of the charm.

Frequently asked questions

How to make a staff with a fireball in Minecraft?

Select "Fire Ball," view and name, download the date pack and put it in the world's datapacks folder. The object gives out /give of the result -- the right click triggers the balloon.

How to make a right click item without mods?

Datapack: inside - a fishing rod with a carrot in the form of any object. The game considers her click as statistics, and the pack on it launches the ability.

Is it possible to place several staves at once?

Yes: each ability has its own namespace, and the fireball, lightning and teleport packs work side by side in the same world.