1

Help me

MarsmiGamer's Avatar MarsmiGamer7/23/18 2:53 am
1 emeralds 140 1
7/23/2018 3:55 pm
CGBrothers's Avatar CGBrothers
How to make that when you have a special object in your hand and where you look with it in your hand, particles are made
Posted by MarsmiGamer's Avatar
MarsmiGamer
Level 2 : Apprentice Miner
0

Create an account or sign in to comment.

1

CGBrothers
07/23/2018 3:55 pm
Level 53 : Grandmaster Lego Builder
CGBrothers's Avatar
Kinda bummed no one commented as this is actually a really fun tool.

The easiest way to do this will be with a Carrot on a Stick. The item itself is practically useless, but, there is a minecraft used statistic that we can use to detect right clicks.

So slap down a block (that is solid) and throw a lever on it so we can turn this off and on as we need. Next to the block, create a repeating command block that has its arrows point out so you can add some chained blocks after it.

The first command you want to TYPE will be /minecraft:give @s minecraft:carrot_on_a_stick{Draw:1b} 1. This command will give you a carrot on a stick that has an NBT tag of Draw:1b, which we can use so that only this specific item will create particles, and a normal carrot on the stick will not.

After that, type /scoreboard objectives add Draw minecraft.used:minecraft.carrot_on_a_stick Draw. What this is doing is creating a scoreboard objective that counts every time a player uses a carrot on a stick -- effectively creating a right click detector for us.

In that first repeating command block, type this: execute at @a[scores={Draw=1},nbt={SelectedItem:{tag:{Draw:1b}}}] run particle dragon_breath ^ ^1.63 ^5 0 0 0 0 5. What a doozy! This command is only executing it's command at any player who has right clicked with a carrot on a stick, but ALSO is holding that special carrot on a stick you just spawned in. Once those two things are set, it is running a particle command to put dragon breath particles in exactly 5 blocks infront of the player.

At this point, you're almost done. We just need to attach one more chained block so that we can turn it off! In this chained block, type: execute as @a[scores={Draw=2}] run scoreboard players set @s Draw 0. What this does, is that when you right click again, it changes your score from 2 to 0, so that you're all set to start it up after you're done.

Feel free to ask any questions
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome