Complete rewrite
Prep for addition of optional additional tools Removed config (for now) Added loads of blocks
This commit is contained in:
12
data/wrench/function/rotate/xyz/click.mcfunction
Normal file
12
data/wrench/function/rotate/xyz/click.mcfunction
Normal file
@@ -0,0 +1,12 @@
|
||||
## X Y Z Click
|
||||
|
||||
# Get Raycast Target Coords
|
||||
function wrench:raycast/target_coords
|
||||
|
||||
## Rotate X Y Z
|
||||
$execute as @s[scores={lz_wrench_success=0}] unless score pz lz_wrench_raycast matches 1..14 store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=z] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}] unless score py lz_wrench_raycast matches 1..14 store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=y] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}] unless score px lz_wrench_raycast matches 1..14 store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=x] replace
|
||||
|
||||
# Failed
|
||||
execute as @s[scores={lz_wrench_success=0}] run scoreboard players set @s lz_wrench_success -1
|
5
data/wrench/function/rotate/xyz/cycle.mcfunction
Normal file
5
data/wrench/function/rotate/xyz/cycle.mcfunction
Normal file
@@ -0,0 +1,5 @@
|
||||
## X Y Z Cycle
|
||||
|
||||
$execute as @s[scores={lz_wrench_success=0}] store result score @s lz_wrench_success run execute if block ~ ~ ~ $(block)[axis=y] run setblock ~ ~ ~ $(block)[axis=x] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}] store result score @s lz_wrench_success run execute if block ~ ~ ~ $(block)[axis=x] run setblock ~ ~ ~ $(block)[axis=z] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}] store result score @s lz_wrench_success run execute if block ~ ~ ~ $(block)[axis=z] run setblock ~ ~ ~ $(block)[axis=y] replace
|
11
data/wrench/function/rotate/xyz/player.mcfunction
Normal file
11
data/wrench/function/rotate/xyz/player.mcfunction
Normal file
@@ -0,0 +1,11 @@
|
||||
## X Y Z Player
|
||||
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=45..90] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=y] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=-90..-45] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=y] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=-45..45, y_rotation=-45..45] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=z] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=-45..45, y_rotation=135..-135] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=z] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=-45..45, y_rotation=45..135] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=x] replace
|
||||
$execute as @s[scores={lz_wrench_success=0}, x_rotation=-45..45, y_rotation=-135..-45] store result score @s lz_wrench_success run setblock ~ ~ ~ $(block)[axis=x] replace
|
||||
|
||||
# Failed
|
||||
execute as @s[scores={lz_wrench_success=0}] run scoreboard players set @s lz_wrench_success -1
|
6
data/wrench/function/rotate/xyz/rotate.mcfunction
Normal file
6
data/wrench/function/rotate/xyz/rotate.mcfunction
Normal file
@@ -0,0 +1,6 @@
|
||||
## X Y Z
|
||||
|
||||
# Rotate Based on Wrench Mode
|
||||
execute as @s[scores={lz_wrench_success=0},nbt={SelectedItem:{components:{"minecraft:lore":["Face Player"]}}}] run function wrench:rotate/xyz/player with storage lz:wrench
|
||||
execute as @s[scores={lz_wrench_success=0},nbt={SelectedItem:{components:{"minecraft:lore":["Face Click"]}}}] run function wrench:rotate/xyz/click with storage lz:wrench
|
||||
execute as @s[scores={lz_wrench_success=0}] run function wrench:rotate/xyz/cycle with storage lz:wrench
|
Reference in New Issue
Block a user