三維彈球+重力教學/附帶動畫演示?。ê貓D指令

三維彈球主體部分指令
#發(fā)射
execute at @a[tag=二分] run tag @e[type=fishing_hook,r=2] add 發(fā)射
execute if entity @e[tag=發(fā)射] at @a[tag=二分] positioned ~~1.62~ run tp @e[tag=發(fā)射] ^^^0.5
execute if entity @e[tag=發(fā)射] at @a[tag=二分] run summon armor_stand ball ~~~
execute if entity @e[tag=發(fā)射] at @a[tag=二分] run tag @e[name=ball,c=1] add ball
execute if entity @e[tag=發(fā)射] run function player
execute if entity @e[tag=發(fā)射] at @a[tag=二分] as @e[name=ball,c=1] run scoreboard players operation @s 二分y =玩家y 二分0
execute if entity @e[tag=發(fā)射] at @a[tag=二分] as @e[name=ball,c=1] run scoreboard players operation @s 二分x =玩家x 二分0
execute if entity @e[tag=發(fā)射] at @a[tag=二分] as @e[name=ball,c=1] run scoreboard players operation @s 二分z =玩家z 二分0
execute if entity @e[tag=發(fā)射] run function ball
execute if entity @e[tag=發(fā)射] run scoreboard players operation @e[tag=ball] 動能y -=玩家y 二分0
execute if entity @e[tag=發(fā)射] run scoreboard players operation @e[tag=ball] 動能x -=玩家x 二分0
execute if entity @e[tag=發(fā)射] run scoreboard players operation @e[tag=ball] 動能z -=玩家z 二分0
execute if entity @e[tag=發(fā)射] run tag @e remove ball
execute if entity @e[tag=發(fā)射] run kill @e[tag=發(fā)射]
#@數(shù)據(jù)轉(zhuǎn)坐標
#y
execute as @e[name=ball] at @s run tp @s 0 -64 0
execute as @e[name=ball] run scoreboard players operation @s 二分 =@s 二分y
execute as @e[name=ball,scores={二分=26368..}] at @s run tp @s ~~327.68~
scoreboard players add @e[name=ball,scores={二分=26368..}] 二分 -32768
execute as @e[name=ball,scores={二分=9984..}] at @s run tp @s ~~163.84~
scoreboard players add @e[name=ball,scores={二分=9984..}] 二分 -16384
execute as @e[name=ball,scores={二分=1792..}] at @s run tp @s ~~81.92~
scoreboard players add @e[name=ball,scores={二分=1792..}] 二分 -8192
execute as @e[name=ball,scores={二分=-2304..}] at @s run tp @s ~~40.96~
scoreboard players add @e[name=ball,scores={二分=-2304..}] 二分 -4096
execute as @e[name=ball,scores={二分=-4352..}] at @s run tp @s ~~20.48~
scoreboard players add @e[name=ball,scores={二分=-4352..}] 二分 -2048
execute as @e[name=ball,scores={二分=-5376..}] at @s run tp @s ~~10.24~
scoreboard players add @e[name=ball,scores={二分=-5376..}] 二分 -1024
execute as @e[name=ball,scores={二分=-5888..}] at @s run tp @s ~~5.12~
scoreboard players add @e[name=ball,scores={二分=-5888..}] 二分 -512
execute as @e[name=ball,scores={二分=-6144..}] at @s run tp @s ~~2.56~
scoreboard players add @e[name=ball,scores={二分=-6144..}] 二分 -256
execute as @e[name=ball,scores={二分=-6272..}] at @s run tp @s ~~1.28~
scoreboard players add @e[name=ball,scores={二分=-6272..}] 二分 -128
execute as @e[name=ball,scores={二分=-6336..}] at @s run tp @s ~~0.64~
scoreboard players add @e[name=ball,scores={二分=-6336..}] 二分 -64
execute as @e[name=ball,scores={二分=-6368..}] at @s run tp @s ~~0.32~
scoreboard players add @e[name=ball,scores={二分=-6368..}] 二分 -32
execute as @e[name=ball,scores={二分=-6384..}] at @s run tp @s ~~0.16~
scoreboard players add @e[name=ball,scores={二分=-6384..}] 二分 -16
execute as @e[name=ball,scores={二分=-6392..}] at @s run tp @s ~0.08~
scoreboard players add @e[name=ball,scores={二分=-6392..}] 二分 -8
execute as @e[name=ball,scores={二分=-6396..}] at @s run tp @s ~~0.04~
scoreboard players add @e[name=ball,,scores={二分=-6396..}] 二分 -4
execute as @e[name=ball,scores={二分=-6398..}] at @s run tp @s ~~0.02~
scoreboard players add @e[name=ball,,scores={二分=-6398..}] 二分 -2
execute as @e[name=ball,scores={二分=-6399..}] at @s run tp @s ~~0.01~
scoreboard players add @e[name=ball,scores={二分=-6399..}] 二分 -1
#x
execute as @e[name=ball] at @s run tp @s 0 ~ ~ -90 0
execute as @e[name=ball] run scoreboard players operation @s 二分 =@s 二分x
execute as @e[name=ball,scores={二分x=..-1}] at @s run tp @s ~~~~180~
scoreboard players operation @e[name=ball,scores={二分x=..-1}] 二分*= 負號 二分0
execute as @e[name=ball,scores={二分=32768..}] at @s run tp @s ^^^327.68
scoreboard players add @e[name=ball,scores={二分=32768..}] 二分 -32768
execute as @e[name=ball,scores={二分=16384..}] at @s run tp @s ^^^163.84
scoreboard players add @e[name=ball,scores={二分=16384..}] 二分 -16384
execute as @e[name=ball,scores={二分=8192..}] at @s run tp @s ^^^81.92
scoreboard players add @e[name=ball,scores={二分=8192..}] 二分 -8192
execute as @e[name=ball,scores={二分=4096..}] at @s run tp @s ^^^40.96
scoreboard players add @e[name=ball,scores={二分=4096..}] 二分 -4096
execute as @e[name=ball,scores={二分=2048..}] at @s run tp @s ^^^20.48
scoreboard players add @e[name=ball,scores={二分=2048..}] 二分 -2048
execute as @e[name=ball,scores={二分=1024..}] at @s run tp @s ^^^10.24
scoreboard players add @e[name=ball,scores={二分=1024..}] 二分 -1024
execute as @e[name=ball,scores={二分=512..}] at @s run tp @s ^^^5.12
scoreboard players add @e[name=ball,scores={二分=512..}] 二分 -512
execute as @e[name=ball,scores={二分=256..}] at @s run tp @s ^^^2.56
scoreboard players add @e[name=ball,scores={二分=256..}] 二分 -256
execute as @e[name=ball,scores={二分=128..}] at @s run tp @s ^^^1.28
scoreboard players add @e[name=ball,scores={二分=128..}] 二分 -128
execute as @e[name=ball,scores={二分=64..}] at @s run tp @s ^^^0.64
scoreboard players add @e[name=ball,scores={二分=64..}] 二分 -64
execute as @e[name=ball,scores={二分=32..}] at @s run tp @s ^^^0.32
scoreboard players add @e[name=ball,scores={二分=32..}] 二分 -32
execute as @e[name=ball,scores={二分=16..}] at @s run tp @s ^^^0.16
scoreboard players add @e[name=ball,scores={二分=16..}] 二分 -16
execute as @e[name=ball,scores={二分=8..}] at @s run tp @s ^^^0.08
scoreboard players add @e[name=ball,scores={二分=8..}] 二分 -8
execute as @e[name=ball,scores={二分=4..}] at @s run tp @s ^^^0.04
scoreboard players add @e[name=ball,,scores={二分=4..}] 二分 -4
execute as @e[name=ball,scores={二分=2..}] at @s run tp @s ^^^0.02
scoreboard players add @e[name=ball,,scores={二分=2..}] 二分 -2
execute as @e[name=ball,scores={二分=1..}] at @s run tp @s ^^^0.01
scoreboard players add @e[name=ball,scores={二分=1..}] 二分 -1
#z
execute as @e[name=ball] at @s run tp @s ~ ~ 0 0 0
execute as @e[name=ball] run scoreboard players operation @s 二分 =@s 二分z
execute as @e[name=ball,scores={二分z=..-1}] at @s run tp @s ~~~~180~
scoreboard players operation @e[name=ball,scores={二分z=..-1}] 二分*= 負號 二分0
execute as @e[name=ball,scores={二分=32768..}] at @s run tp @s ^^^327.68
scoreboard players add @e[name=ball,scores={二分=32768..}] 二分 -32768
execute as @e[name=ball,scores={二分=16384..}] at @s run tp @s ^^^163.84
scoreboard players add @e[name=ball,scores={二分=16384..}] 二分 -16384
execute as @e[name=ball,scores={二分=8192..}] at @s run tp @s ^^^81.92
scoreboard players add @e[name=ball,scores={二分=8192..}] 二分 -8192
execute as @e[name=ball,scores={二分=4096..}] at @s run tp @s ^^^40.96
scoreboard players add @e[name=ball,scores={二分=4096..}] 二分 -4096
execute as @e[name=ball,scores={二分=2048..}] at @s run tp @s ^^^20.48
scoreboard players add @e[name=ball,scores={二分=2048..}] 二分 -2048
execute as @e[name=ball,scores={二分=1024..}] at @s run tp @s ^^^10.24
scoreboard players add @e[name=ball,scores={二分=1024..}] 二分 -1024
execute as @e[name=ball,scores={二分=512..}] at @s run tp @s ^^^5.12
scoreboard players add @e[name=ball,scores={二分=512..}] 二分 -512
execute as @e[name=ball,scores={二分=256..}] at @s run tp @s ^^^2.56
scoreboard players add @e[name=ball,scores={二分=256..}] 二分 -256
execute as @e[name=ball,scores={二分=128..}] at @s run tp @s ^^^1.28
scoreboard players add @e[name=ball,scores={二分=128..}] 二分 -128
execute as @e[name=ball,scores={二分=64..}] at @s run tp @s ^^^0.64
scoreboard players add @e[name=ball,scores={二分=64..}] 二分 -64
execute as @e[name=ball,scores={二分=32..}] at @s run tp @s ^^^0.32
scoreboard players add @e[name=ball,scores={二分=32..}] 二分 -32
execute as @e[name=ball,scores={二分=16..}] at @s run tp @s ^^^0.16
scoreboard players add @e[name=ball,scores={二分=16..}] 二分 -16
execute as @e[name=ball,scores={二分=8..}] at @s run tp @s ^^^0.08
scoreboard players add @e[name=ball,scores={二分=8..}] 二分 -8
execute as @e[name=ball,scores={二分=4..}] at @s run tp @s ^^^0.04
scoreboard players add @e[name=ball,,scores={二分=4..}] 二分 -4
execute as @e[name=ball,scores={二分=2..}] at @s run tp @s ^^^0.02
scoreboard players add @e[name=ball,,scores={二分=2..}] 二分 -2
execute as @e[name=ball,scores={二分=1..}] at @s run tp @s ^^^0.01
scoreboard players add @e[name=ball,scores={二分=1..}] 二分 -1
#@觸地&重力
execute as @e[name=ball,scores={動能y=-300..}] at @s if block ~~-1~ air run scoreboard players add @s 動能y -4
#-y
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能x/= 水平 二分0
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能z/= 水平 二分0
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能y=..-1}] at @s unless block ~~-1~ air run scoreboard players operation @s 動能y/= 除 二分0
#+y
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能x/= 水平 二分0
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能z/= 水平 二分0
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能y=1..}] at @s unless block ~~1~ air run scoreboard players operation @s 動能y/= 除 二分0
#-x
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能y/= 水平 二分0
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能z/= 水平 二分0
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能x=..-1}] at @s unless block ~-1~~ air run scoreboard players operation @s 動能x/= 除 二分0
#+x
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能y/= 水平 二分0
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能z/= 水平 二分0
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能x=1..}] at @s unless block ~1~~ air run scoreboard players operation @s 動能x/= 除 二分0
#-z
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能y/= 水平 二分0
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能x/= 水平 二分0
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能z=..-1}] at @s unless block ~~~-1 air run scoreboard players operation @s 動能z/= 除 二分0
#+z
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能y*= 乘 二分0
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能y/= 水平 二分0
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能x*= 乘 二分0
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能x/= 水平 二分0
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能z*= 乘 二分0
execute as @e[name=ball,scores={動能z=1..}] at @s unless block ~~~1 air run scoreboard players operation @s 動能z/= 除 二分0
#同步
execute as @e[name=ball] run scoreboard players operation @s 二分y +=@s 動能y
execute as @e[name=ball] run scoreboard players operation @s 二分x +=@s 動能x
execute as @e[name=ball] run scoreboard players operation @s 二分z +=@s 動能z
#通用
execute as @e[type=armor_stand] at @s run tp ~~~
effect @e[type=armor_stand] invisibility 1 0 true
execute at @e[name=ball] run particle minecraft:balloon_gas_particle ~~~
kill @e[name=ball,scores={二分y=..-6500}]
by萌鯊無敵