-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
106 additions
and
19 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$execute positioned $(x) $(y) $(z) run $(_) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
datapacks/Bookshelf/data/bs.view/predicates/is_looking_at_entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"condition": "minecraft:entity_properties", | ||
"entity": "this", | ||
"predicate": { | ||
"type_specific": { | ||
"type": "player", | ||
"looking_at": { | ||
"nbt": "{Tags:[\"bs.view.is_lookable\"]}" | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/as_aimed_entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:as_aimed_entity" | ||
"bs.view:as/aimed_entity" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/as_looked_entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:as_looked_entity" | ||
"bs.view:as/looked_entity" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/at_aimed_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:at_aimed_block" | ||
"bs.view:at/aimed_block" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/at_aimed_entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:at_aimed_entity" | ||
"bs.view:at/aimed_entity" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/at_aimed_point.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:at_aimed_point" | ||
"bs.view:at/aimed_point" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/at_looked_entity.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:at_looked_entity" | ||
"bs.view:at/looked_entity" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
datapacks/Bookshelf/data/bs.view/tags/functions/at_placed_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"values": [ | ||
"bs.view:at_placed_block" | ||
"bs.view:at/placed_block" | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/as/aimed_entity.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run as the targeted entity | ||
# @batch bs.view | ||
# @dummy | ||
|
||
summon minecraft:armor_stand ~.5 ~ ~1.5 {Tags:["bs.raycast.is_solid"],NoGravity:1b} | ||
function #bs.view:as_aimed_entity {run:"tag @s add found"} | ||
assert entity @e[type=minecraft:armor_stand,tag=found] inside |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/as/looked_entity.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run as the looked at entity | ||
# @batch bs.view | ||
# @dummy | ||
|
||
summon minecraft:armor_stand ~.5 ~ ~1.5 {Tags:["bs.view.is_lookable"],NoGravity:1b} | ||
function #bs.view:as_looked_entity {run:"tag @s add found"} | ||
assert entity @e[type=minecraft:armor_stand,tag=found] inside |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/at/aimed_block.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run at the targeted block | ||
# @batch bs.view | ||
# @dummy | ||
|
||
setblock ~ ~1 ~1 minecraft:sponge | ||
function #bs.view:at_aimed_block {run:"setblock ~ ~ ~ minecraft:bookshelf"} | ||
assert block ~ ~1 ~1 minecraft:bookshelf |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/at/aimed_entity.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run at the targeted entity | ||
# @batch bs.view | ||
# @dummy | ||
|
||
summon minecraft:armor_stand ~.5 ~ ~1.5 {Tags:["bs.raycast.is_solid"],NoGravity:1b} | ||
function #bs.view:at_aimed_entity {run:"tag @e[distance=0] add found"} | ||
assert entity @e[type=minecraft:armor_stand,tag=found] inside |
8 changes: 8 additions & 0 deletions
8
datapacks/Bookshelf/data/bs.view/tests/at/aimed_point.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Callback is run at the hit point | ||
# @batch bs.view | ||
# @dummy | ||
|
||
setblock ~ ~1 ~1 minecraft:bookshelf | ||
function #bs.view:at_aimed_point {run:"summon minecraft:marker ~ ~ ~ {UUID:[181,0,0,0]}"} | ||
execute store success score #success bs.data run data modify entity B5-0-0-0-0 Pos set from storage bs:out raycast.hit_point | ||
assert score #success bs.data matches 0 |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/at/looked_entity.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run at the looked at entity | ||
# @batch bs.view | ||
# @dummy | ||
|
||
summon minecraft:armor_stand ~.5 ~ ~1.5 {Tags:["bs.view.is_lookable"],NoGravity:1b} | ||
function #bs.view:at_looked_entity {run:"tag @e[distance=0] add found"} | ||
assert entity @e[type=minecraft:armor_stand,tag=found] inside |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/at/placed_block.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Callback is run at the placed block | ||
# @batch bs.view | ||
# @dummy | ||
|
||
setblock ~ ~1 ~1 minecraft:sponge | ||
function #bs.view:at_placed_block {run:"setblock ~ ~ ~ minecraft:bookshelf"} | ||
assert block ~ ~1 ~ minecraft:bookshelf |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/can_see_ata.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Check the whole distance between the executor and the position | ||
# @batch bs.view | ||
# @dummy | ||
|
||
setblock ~ ~1 ~1 minecraft:bookshelf | ||
execute at @s positioned ~ ~1 ~.5 if function #bs.view:can_see_ata run fail "Position must be obstructed when reaching a block" | ||
execute at @s positioned ~ ~1 ~.49 unless function #bs.view:can_see_ata run fail "Position must be unobstructed before reaching a block" |
7 changes: 7 additions & 0 deletions
7
datapacks/Bookshelf/data/bs.view/tests/in_view_ata.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Check multiple vision angles | ||
# @batch bs.view | ||
# @dummy | ||
|
||
data modify storage bs:in view.in_view_ata.angle set value 90 | ||
execute at @s anchored eyes positioned ^1 ^ ^1 if function #bs.view:in_view_ata run fail "Position must not be within the 90-degree viewing angle" | ||
execute at @s anchored eyes positioned ^.99 ^ ^1 unless function #bs.view:in_view_ata run fail "Position must be within the 90-degree viewing angle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters