Designing Custom Minecraft Weapons: Cooldowns, Hit Events, and Area Effects
Turn a basic custom sword or wand into a real gameplay mechanic with hit triggers, status effects, raycasts, and right-click cooldowns.
Adding a sword with higher attack damage takes only a few seconds, but players remember weapons that change how they fight: a blade that freezes enemies in place, a staff that teleports you where you look, or a heavy hammer that shatters a 3x3 wall of stone at once.
In makemods.app, you build mechanics like these by wiring an Item node to event, condition, and action nodes on the graph. Here are three practical patterns you can use in your own mods.
1. On-hit effects: the Frost Sword
Suppose you want a custom sword crafted from ice that inflicts Slowness on anything it hits.
- Create the item and recipe. Add an Item node named Frost Sword (with Type set to sword and a Tool material) and a Crafting (shaped) recipe using ice and a stick.
- Listen for player attacks. Add When player hits. By default, this event fires whenever a player damages any mob, animal, or player.
- Check the held weapon. Check Is holding or wearing (listing Frost Sword), and feed its output into an If node.
- Apply the effect. From the If node’s true port, connect Add effect with
slowness, a duration of5seconds, and level1. Wire When player hits’s Hit entity output into Add effect so the slowness lands on the target that was struck, not the attacker.
Want the sword to deal bonus damage against fiery mobs? Check Entity is on the target, and run Change damage or Damage along the same hit flow. Because Damage inside a hit event attributes the extra damage to the same attacker, kill credit and loot drops still work as expected. See Hits and damage for every combat step.
2. Right-click abilities and cooldowns: the Teleport Staff
Right-click weapons and wands use Right-clicks events. When a player right-clicks in the air while holding your item, When item is used runs.
To build a staff that teleports the player to the block they are aiming at:
- Set a cooldown on the item. On your Teleport Staff Item node, set Cooldown (ticks) to
40(2seconds, since 20 ticks equal 1 second). When the item is used, Minecraft automatically plays the ender-pearl grey-out animation in the hotbar and blocks repeat clicks until the timer finishes. - Find where the player is looking. Add Looked-at block with a Distance of
24blocks. - Teleport beside the block, not inside it. Looked-at block has two position outputs: Block (the solid block aimed at) and In front (the empty air space against the face you looked at). Wire In front into Teleport so the player lands cleanly on or next to the surface.
What if you trigger an ability from an event that doesn’t use the item normally, such as sneaking (When player sneaks) or pressing a custom key (When key is pressed)? Pair Is on cooldown with Start cooldown:
- Check Is on cooldown inside an If node first.
- When false, run your ability and then call Start cooldown for your item.
3. Area block breaking: the 3x3 Mining Hammer
Tools that mine multiple blocks at once use When block is broken together with Break block:
- Add When block is broken and filter Blocks to
#minecraft:mineable/pickaxeso the hammer only triggers on stone, ores, and other pickaxe blocks. - Check Is holding or wearing for your hammer with an If node.
- Run Break block with Area set to
3x3(or5x5). The3x3plane automatically rotates to match the face the player mined.
For a tree-felling axe or a vein-mining pickaxe, switch Area on Break block to Connected and set Up to to the maximum number of connected logs or ore blocks to harvest in one swing. Unbreakable blocks like bedrock are skipped automatically, and broken blocks only drop items when the player’s held tool can harvest them. See Positions for more spatial nodes.
Open the guest editor to try wiring the Frost Sword and Ruby Wand graphs yourself, or start a free project and ask the AI to build your weapon idea on the canvas.
More guides
- Why an AI Minecraft Mod Maker Works Better as a Node GraphPrompt-only generators hand you a black-box download. When AI edits a visual node graph, you can see, tweak, and undo every change.
- How to Make a Minecraft Mod Without CodingBuild custom items, blocks, crafting recipes, and gameplay mechanics in your browser using a visual node graph and AI.
- NeoForge vs Fabric vs Bedrock Add-Ons: Choosing a Target for Your ModHow Java Edition mod loaders compare with Bedrock Edition add-ons, what each platform supports, and how to build for any of them from one graph.