En ce moment, je suis en train de créer un objet "tuyau d'incendie" qui projette des bouteilles d'eau. La vitesse et tout le reste fonctionnent, mais pour une raison ou une autre, les bouteilles tombent beaucoup plus vite que prévu, et la trajectoire est la même que si je les avais lancées. J'ai essayé le tag NoGravity mais ça ne marche pas, donc s'il y a un moyen de faire en sorte qu'elle aille là où le curseur pointe, à part le raycasting et le spawning à ce bloc, ce serait génial. Voici ma fonction pour le lancer : la commande summon est à la ligne 2 :
#summon water
summon minecraft:potion ^ ^ ^1 {NoGravity:1,CustomName:"\"firewandwater\"",Potion:{id:"minecraft:splash_potion",Count:1,tag:{Potion:"minecraft:water"}}}
#get player and water data into scoreboards
execute as @s store result score @s fwx run data get entity @s Pos[0] 100
execute as @s store result score @s fwy run data get entity @s Pos[1] 100
execute as @s store result score @s fwz run data get entity @s Pos[2] 100
execute as @e[name=firewandwater] store result score @s fwx run data get entity @s Pos[0] 100
execute as @e[name=firewandwater] store result score @s fwy run data get entity @s Pos[1] 100
execute as @e[name=firewandwater] store result score @s fwz run data get entity @s Pos[2] 100
#subtract the two to get a momentum/velocity and put into water's scoreboard
execute as @e[name=firewandwater] store result score @s fwx run scoreboard players operation @s fwx -= @p fwx
execute as @e[name=firewandwater] store result score @s fwy run scoreboard players operation @s fwy -= @p fwy
execute as @e[name=firewandwater] store result score @s fwz run scoreboard players operation @s fwz -= @p fwz
#tp the water so it's like it's going from eye position
execute as @e[name=firewandwater] at @s run tp @s ~ ~1.62 ~
#put the subtracted value into the potion's Motion
execute as @e[name=firewandwater] store result entity @s Motion[0] double 0.01 run scoreboard players get @s fwx
execute as @e[name=firewandwater] store result entity @s Motion[1] double 0.01 run scoreboard players get @s fwy
execute as @e[name=firewandwater] store result entity @s Motion[2] double 0.01 run scoreboard players get @s fwz
#reset the scoreboards
scoreboard players reset @e fwx
scoreboard players reset @e fwy
scoreboard players reset @e fwz
execute run scoreboard players reset firewandClicks
execute run scoreboard players set @e firewandClicks 0
#reset customName so ater isn't affected by new ater
execute as @e[name=firewandwater] at @s run data merge entity @s {CustomName:""}
L'eau devrait frapper le haut du mur de briques, mais à la place elle frappe le milieu :