-
-
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.
♻️ Update painter example for the 2.1.0
- Loading branch information
Showing
15 changed files
with
33 additions
and
62 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
datapacks/Bookshelf Examples/data/bs.example.painter/advancement/use_brush.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,18 @@ | ||
{ | ||
"criteria": { | ||
"requirement": { | ||
"trigger": "minecraft:using_item", | ||
"conditions": { | ||
"item": { | ||
"items": "minecraft:brush", | ||
"predicates": { | ||
"minecraft:custom_data": "{\"bs.example.painter:brush\":true}" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"rewards": { | ||
"function": "bs.example.painter:use_brush" | ||
} | ||
} |
39 changes: 0 additions & 39 deletions
39
datapacks/Bookshelf Examples/data/bs.example.painter/advancements/use_brush.json
This file was deleted.
Oops, something went wrong.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
datapacks/Bookshelf Examples/data/bs.example.painter/function/__tick__.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,6 @@ | ||
# We use both an advancement and an objective for educational purposes and to handle potential limitations: | ||
# - Advancements allow continuous usage but may fail with certain blocks like signs. | ||
# - Scores work universally but cannot be used continuously. | ||
|
||
# Run the use_brush function if the brush is used. | ||
execute as @a[scores={bs.example.painter.use_brush=1..}] run function bs.example.painter:use_brush |
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
3 changes: 2 additions & 1 deletion
3
...le.painter/functions/use_brush.mcfunction → ...ple.painter/function/use_brush.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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Executes a function to replace the block the player is aiming at, within a maximum distance of 5 blocks. | ||
function #bs.view:at_aimed_block { run: "function bs.example.painter:replace_block", with: { max_distance: 5 }} | ||
|
||
# Revokes the brush use advancement. This must be done after everything else to keep track of which brush was used. | ||
# Resets the brush use score and revokes the advancement. | ||
scoreboard players reset @s bs.example.painter.use_brush | ||
advancement revoke @s only bs.example.painter:use_brush |
16 changes: 0 additions & 16 deletions
16
datapacks/Bookshelf Examples/data/bs.example.painter/functions/__tick__.mcfunction
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.