-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
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,3 +1,6 @@ | ||
#region Initialize scoreboards | ||
scoreboard objectives add beeadult dummy | ||
scoreboard objectives add beebaby dummy | ||
scoreboard objectives add beeamount dummy | ||
scoreboard objectives add beeamount dummy | ||
scoreboard objectives add beeage dummy | ||
#endregion |
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,8 +1,24 @@ | ||
execute store result score @s beeamount run data get block ~ ~ ~ Bees | ||
execute store result score @s beeadult if data block ~ ~ ~ Bees[{EntityData:{Age:0}}] | ||
scoreboard players operation @s beebaby = @s beeamount | ||
scoreboard players operation @s beebaby -= @s beeadult | ||
#region query "Bee 1"'s age | ||
execute store result score @s beeage if data block ~ ~ ~ Bees[0].EntityData.Age run data get block ~ ~ ~ Bees[0].EntityData.Age | ||
execute if data block ~ ~ ~ Bees[0].EntityData.Age if score @s beeage matches 0.. run scoreboard players add @s beeadult 1 | ||
execute if data block ~ ~ ~ Bees[0].EntityData.Age if score @s beeage matches ..-1 run scoreboard players add @s beebaby 1 | ||
#endregion | ||
#region query "Bee 2"'s age | ||
execute store result score @s beeage if data block ~ ~ ~ Bees[1].EntityData.Age run data get block ~ ~ ~ Bees[1].EntityData.Age | ||
execute if data block ~ ~ ~ Bees[1].EntityData.Age if score @s beeage matches 0.. run scoreboard players add @s beeadult 1 | ||
execute if data block ~ ~ ~ Bees[1].EntityData.Age if score @s beeage matches ..-1 run scoreboard players add @s beebaby 1 | ||
#endregion | ||
#region query "Bee 3"'s age | ||
execute store result score @s beeage if data block ~ ~ ~ Bees[2].EntityData.Age run data get block ~ ~ ~ Bees[2].EntityData.Age | ||
execute if data block ~ ~ ~ Bees[2].EntityData.Age if score @s beeage matches 0.. run scoreboard players add @s beeadult 1 | ||
execute if data block ~ ~ ~ Bees[2].EntityData.Age if score @s beeage matches ..-1 run scoreboard players add @s beebaby 1 | ||
#endregion | ||
title @s actionbar ["",{"text":"[蜜蜂助手] ","color":"gold"},{"score":{"name":"*","objective":"beeamount"}},"只蜜蜂,成年的",{"score":{"name":"*","objective":"beeadult"}},"只,幼年的",{"score":{"name":"*","objective":"beebaby"}},"只"] | ||
scoreboard players set @a beeamount 0 | ||
#region reset scoreboards | ||
#shouldn't use "reset" operation, which may cause a null result | ||
scoreboard players set @s beeamount 0 | ||
scoreboard players set @s beeadult 0 | ||
scoreboard players set @s beebaby 0 | ||
scoreboard players set @s beebaby 0 | ||
scoreboard players set @s beeage 0 | ||
#endregion |
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 +1 @@ | ||
execute as @a[predicate=beeutility:hold_glass_bottle] at @s anchored eyes positioned ^ ^ ^ anchored feet run function beeutility:ray | ||
execute as @a[predicate=beeutility:hold_glass_bottle] at @s anchored eyes positioned ^ ^ ^ anchored feet run function beeutility:ray |