1.13 snapshots have raycasting, which would make this work better.
Problem: 1.13 commands are now confusing.
I'm just looking for a way for when I right click with a certain thing (Which I might need a little bit of help with, but I've made it in 1.12 before) I shoot an arrow in the direction I am facing.
What is the "Wand" objective for?
Anyway, this is a repeated arrow teleportation system, but we could even put motion instead. Here's how to make it :
-Make a .mcfunction file
-Copy all this stuff inside
-Create 3 dummies objectifes : "pos_x","pos_y","pos_z"
-Create an objective named "click" that will trigger a shot
-Make something like "execute as @a[scores={click=1..}] at @s run function [path of the mcfunction file]
summon minecraft:area_effect_cloud ^ ^ ^20 {Duration:0,Tags:["ShootDirection"]}
execute store result score @s pos_x run data get entity @s Pos[0] 10
execute store result score @s pos_y run data get entity @s Pos[1] 10
execute store result score @s pos_z run data get entity @s Pos[2] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_x run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[0] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_y run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[1] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_z run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[2] 10
tp @e[type=minecraft:area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] @s
scoreboard players operation @s pos_x -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_x
scoreboard players operation @s pos_y -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_y
scoreboard players operation @s pos_z -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_z
execute anchored eyes positioned ^ ^ ^ run summon minecraft:arrow ~ ~ ~ {damage:0.4d,life:1199s,Color:-1,Tags:["ColtM1911Ammo","Ammo"],Silent:1}
playsound minecraft:entity.firework_rocket.blast_far master @a ~ ~ ~ 1 1
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[0] double -0.05 run scoreboard players get @p pos_x
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[1] double -0.05 run scoreboard players get @p pos_y
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[2] double -0.05 run scoreboard players get @p pos_z
execute anchored eyes run particle minecraft:flame ^-0.4 ^ ^0.7 0 0 0 0 1 normal
tp @s ~ ~ ~ ~ ~-5
scoreboard players remove @s click 1
It's a copy of a datapack I created for a huge project still in work!
Simply set your click score to 1 for shooting
How it works : The player summons an area_effect_clouds in front of him, gets its coords, then compare it with its own coords. Then, it summons an arrow and give him a motion equal to the result pos_x/pos_y/pos_z final score
Somewhat complicated, but works!
And most important : as it works with motion, you don't have to make all kind of systems for affecting the arrow!
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
What is the "Wand" objective for?
Anyway, this is a repeated arrow teleportation system, but we could even put motion instead. Here's how to make it :
-Make a .mcfunction file
-Copy all this stuff inside
-Create 3 dummies objectifes : "pos_x","pos_y","pos_z"
-Create an objective named "click" that will trigger a shot
-Make something like "execute as @a[scores={click=1..}] at @s run function [path of the mcfunction file]
summon minecraft:area_effect_cloud ^ ^ ^20 {Duration:0,Tags:["ShootDirection"]}
execute store result score @s pos_x run data get entity @s Pos[0] 10
execute store result score @s pos_y run data get entity @s Pos[1] 10
execute store result score @s pos_z run data get entity @s Pos[2] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_x run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[0] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_y run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[1] 10
execute store result score @e[type=area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] pos_z run data get entity @e[type=minecraft:area_effect_cloud,tag=ShootDirection,limit=1,distance=19.8..20.2] Pos[2] 10
tp @e[type=minecraft:area_effect_cloud,tag=ShootDirection,distance=19.8..20.2] @s
scoreboard players operation @s pos_x -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_x
scoreboard players operation @s pos_y -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_y
scoreboard players operation @s pos_z -= @e[type=area_effect_cloud,tag=ShootDirection,limit=1,sort=nearest] pos_z
execute anchored eyes positioned ^ ^ ^ run summon minecraft:arrow ~ ~ ~ {damage:0.4d,life:1199s,Color:-1,Tags:["ColtM1911Ammo","Ammo"],Silent:1}
playsound minecraft:entity.firework_rocket.blast_far master @a ~ ~ ~ 1 1
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[0] double -0.05 run scoreboard players get @p pos_x
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[1] double -0.05 run scoreboard players get @p pos_y
execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[2] double -0.05 run scoreboard players get @p pos_z
execute anchored eyes run particle minecraft:flame ^-0.4 ^ ^0.7 0 0 0 0 1 normal
tp @s ~ ~ ~ ~ ~-5
scoreboard players remove @s click 1
It's a copy of a datapack I created for a huge project still in work!
Simply set your click score to 1 for shooting
How it works : The player summons an area_effect_clouds in front of him, gets its coords, then compare it with its own coords. Then, it summons an arrow and give him a motion equal to the result pos_x/pos_y/pos_z final score
Somewhat complicated, but works!
And most important : as it works with motion, you don't have to make all kind of systems for affecting the arrow!
I modified my commands because some of them were wrong. (I'm so dumb.)
How exactly would I use this to shoot a fireball in a direction and modify its power value? I've been messing around with that command you posted but I can't really read some parts of commands still so I don't know how to modify that into a thing I can use. Also is it possible for the right click objective to only register with a specific item type with a specific name? I'm making a little magic datapack for my brother and I to use and I'm almost done but this is something I'm stuck on still
First, give your custom item a custom tag (give @s minecraft:carrot_on_a_stick{Magic:1})
-remove the "scoreboard players remove @s click 1" at the end of my function and put "scoreboard players remove @a[scores={click=1..}] click 1" in your tick-executed function instead
-Then, firstly on your tick function, add "/execute as @a[nbt={SelectedItem:{Magic:1}}] at @s run function [my function's path]"
-In "execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[0] double -0.05 run scoreboard players get @p pos_x", the "Motion[0] represents the arrow motion data, so for a fireball :
1.Replace the arrow summoning command by a fireball summoning, and also replace all "arrow" by "fireball"
2.Replace all "Motion[x]" by "Direction[x]" (as fireballs use direction tag)
Uh... It's only a quick view, but I could make a little datapack just for showing you how to get that... I'm quite busy now, but I'll do this as soon as I have some time for it!
Rollback Post to RevisionRollBack
I got into chiptune music composition.
You can listen to them on my Youtube channel : https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
1.13 snapshots have raycasting, which would make this work better.
Problem: 1.13 commands are now confusing.
I'm just looking for a way for when I right click with a certain thing (Which I might need a little bit of help with, but I've made it in 1.12 before) I shoot an arrow in the direction I am facing.
It's pretty simple-ish.
Try this:
===================================================================================================
Chat Commands:
/scoreboard objectives add RClick minecraft.used:minecraft.carrot_on_a_stick
Repeating Commands:
/execute as @a[scores={RClick=1..}] at @s run summon arrow ~ ~ ~ {NoGravity:1,Tags:["Arrow"]}
/execute at @a[scores={RClick=1..}] run tp @e[type=arrow,tag=Arrow,sort=nearest,distance=..1] @p[scores={RClick=..1}]
/execute at @a[scores={RClick=1..}] run tp @e[type=arrow,tag=Arrow,sort=nearest,distance=..1] ~ ~1.5 ~
/execute at @e[type=arrow,tag=Arrow] run tp @e[type=arrow,tag=Arrow,distance=..1] ^ ^ ^1
/scoreboard players reset @a[scores={RClick=1..}] RClick
/scoreboard players add @e[type=arrow,tag=Arrow] RClick 1
/kill @e[type=arrow,tag=Arrow,scores={RClick=100..}]
===================================================================================================
I Think These Commands Are What You're Looking For.
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!
this does not work
What is the "Wand" objective for?
Anyway, this is a repeated arrow teleportation system, but we could even put motion instead. Here's how to make it :
-Make a .mcfunction file
-Copy all this stuff inside
-Create 3 dummies objectifes : "pos_x","pos_y","pos_z"
-Create an objective named "click" that will trigger a shot
-Make something like "execute as @a[scores={click=1..}] at @s run function [path of the mcfunction file]
It's a copy of a datapack I created for a huge project still in work!
Simply set your click score to 1 for shooting
How it works : The player summons an area_effect_clouds in front of him, gets its coords, then compare it with its own coords. Then, it summons an arrow and give him a motion equal to the result pos_x/pos_y/pos_z final score
Somewhat complicated, but works!
And most important : as it works with motion, you don't have to make all kind of systems for affecting the arrow!
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).
I modified my commands because some of them were wrong. (I'm so dumb.)
==Links==
๐๐๐๐จ๐ง๐ ๐๐ก๐๐ง๐ง๐๐ฅ- https://www.youtube.com/channel/UCQYroXqdZtYBnyspneetBGA/featured
๐๐ง๐ฌ๐ญ๐๐ ๐ซ๐๐ฆ- https://www.instagram.com/cowsdabest_yt/?hl=en
๐๐ฐ๐ข๐ญ๐ญ๐๐ซ- https://twitter.com/cowsdabestyt
๐๐ข๐ฌ๐๐จ๐ซ๐- https://discord.gg/H2NfhpQ
==DISCLAIMER!==
Please credit me if you are going to use it in a video or a map!
How exactly would I use this to shoot a fireball in a direction and modify its power value? I've been messing around with that command you posted but I can't really read some parts of commands still so I don't know how to modify that into a thing I can use. Also is it possible for the right click objective to only register with a specific item type with a specific name? I'm making a little magic datapack for my brother and I to use and I'm almost done but this is something I'm stuck on still
Of course!
First, give your custom item a custom tag (give @s minecraft:carrot_on_a_stick{Magic:1})
-remove the "scoreboard players remove @s click 1" at the end of my function and put "scoreboard players remove @a[scores={click=1..}] click 1" in your tick-executed function instead
-Then, firstly on your tick function, add "/execute as @a[nbt={SelectedItem:{Magic:1}}] at @s run function [my function's path]"
-In "execute as @e[type=minecraft:arrow,tag=ColtM1911Ammo] at @s run execute store result entity @s Motion[0] double -0.05 run scoreboard players get @p pos_x", the "Motion[0] represents the arrow motion data, so for a fireball :
1.Replace the arrow summoning command by a fireball summoning, and also replace all "arrow" by "fireball"
2.Replace all "Motion[x]" by "Direction[x]" (as fireballs use direction tag)
Uh... It's only a quick view, but I could make a little datapack just for showing you how to get that... I'm quite busy now, but I'll do this as soon as I have some time for it!
I got into chiptune music composition.
You can listen to them on my Youtube channel :
https://www.youtube.com/channel/UCjWYbJGk7nvNDbnCvMlZGkw
Descriptions are in french, you'd just need some google translation copy-paste...
Also made some more or less complicated datapacks, shared here (planetminecraft).