-
-
Notifications
You must be signed in to change notification settings - Fork 67
Blossoming Pots #1070
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Bloo-dev
merged 60 commits into
Gamemode4Dev:master
from
runcows:gm4-blossoming-pots-intial
Feb 9, 2025
Merged
Blossoming Pots #1070
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
b20c7fb
Initial Commit
runcows 85a3579
Refactor to only summon displays as they are used.
runcows 884bc5c
Added main types
runcows 6488bd1
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows b85c91a
slight corrections in set_storages
runcows a756fc1
Edit raycasts to use player.block_interaction_range
runcows 25f2d10
Added overlay for block_interaction_range since mojang removed the pl…
runcows 43398e1
Cleaning up some comments
runcows 669528f
Remove overlay because I didn't need to do it at all
runcows 0a18491
Removed stages and plantables talked about in meeting. Still need to …
runcows 3f42c46
Fix decorated pot plants not initializing when more items than stages
runcows 0d1e89f
Changes to plantables as discussed
runcows 4b10837
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 30340bf
Added overlay for 1.21.4 and changed storage version_history array to…
runcows e2aab6e
Fix decorated pot temp marker not being removed when pot is empty
runcows 3f5955f
Simplify block interaction range raycast range to not need scoreboard…
runcows 8d0e9ff
Changes from Bloo's comments
runcows 7ce25a8
Adding icon
runcows d5a1a67
Fixing my new entry in contributors.json not being inserted alphabeti…
runcows f55f575
Remove cocoa beans from README
runcows 8de3e09
Fix break and replace partial plant cannibalizing
runcows 002d60c
Fix plant rotation not being locked for newly summoned displays of a …
runcows da4351a
Implement Bloo's suggestion for in_pot changes to not need to select …
runcows 63a4bf3
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows a897a52
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 9556ff8
Add webp animation (20fps, compressed to 351 KB)
runcows a2035fb
Change my contributors.json link to bluesky for upcoming changes
runcows 542d9b0
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 9ae9e04
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 7db3bcb
Update header of gm4_blossoming_pots/data/gm4_blossoming_pots/functio…
runcows 8b19a34
Change function header "with" lines to follow the style bloo specifie…
runcows dad1bd0
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 06ed2ae
Change as_player -> as marker selectors to limit 1
runcows bd40b5b
Change player rotation data to use storage instead of marker data
runcows b5e4698
Fix empty hand scenario being overlooked by player rotation changes
runcows 4127daf
Change empty hand interact on flower pot to summon an item at players…
runcows ebff299
Assorted changes from review session
runcows a07dd26
Rename advancements
runcows eae18a5
Refactor vanilla flower pot handling
runcows 362ba7c
Comments on potential changes
runcows 6db62ad
Refactor decorated pot handling
runcows 1c81619
Rename vanilla_pot_handling/in_pot
runcows 5331209
Refactor flower pot handling
runcows 9822155
Function header changes
runcows 8100f28
Change distance range to be self consistent with module
runcows 264108e
Condense flower pot clean up
runcows 4c96a48
Combine like selectors into one function
runcows b02c00e
Comment format change
runcows bdcf7d9
Fix temp storage not being reset
runcows ff1b1c9
Remove player nbt UUID check
runcows 0fdcddc
Fix issues from changes
runcows c698378
Merge branch 'master' of https://github.com/Gamemode4Dev/GM4_Datapack…
runcows 0eba8db
Wrap marker data in gm4_blossoming_pots tag
runcows b282b53
Replace FallDistance stage tracking with Scoreboard
runcows 5f30f5f
Update gm4_blossoming_pots/beet.yaml
runcows e83f651
Update gm4_blossoming_pots/beet.yaml
runcows cc83d68
Update gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorate…
runcows fd7ca5e
Merge branch 'gm4-blossoming-pots-intial' of https://github.com/runco…
runcows ff074b0
Fix main marker cleanup macro not reflecting change in marker data wr…
runcows b0f22d5
Fix anchored eyes not moving execution context on first raycast loop
runcows File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
| # Blossoming Pots<!--$headerTitle--><!--$pmc:delete--> | ||
|
|
||
| Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style! <!--$pmc:headerSize--> | ||
|
|
||
| ### Features | ||
| - Some plants have multiple different heights or options depending on how many items you put in the pot. | ||
| - Directional plants are placed oriented towards you. | ||
| - Allows you to plant the following | ||
| - All Flowers (including 2 tall) | ||
| - All Saplings (including azaleas and propagules) | ||
| - All Leaves | ||
| - Cactus | ||
| - All Fungi | ||
| - All Dead / Alive Coral, Coral Fans & Coral Blocks! | ||
| - Nether Roots & Vines | ||
| - Tall & Short Grass | ||
| - Tall & Short Ferns | ||
| - Dead Bush | ||
| - All Lush Cave Plants | ||
| - Sweet Berry Bush | ||
| - Kelp, Seagrass, Sea Pickle | ||
| - All Seeds | ||
| - Netherwart | ||
| - Cocoa Beans | ||
| - Chorus Flowers | ||
| - Wheat | ||
| - All Amethyst Buds & Clusters | ||
| - Dripstone |
This file contains hidden or 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,36 @@ | ||
| id: gm4_blossoming_pots | ||
| name: Blossoming Pots | ||
| version: 3.0.X | ||
| # should I start the version number over for gm4 release? | ||
| data_pack: | ||
| load: . | ||
|
|
||
| resource_pack: | ||
| load: . | ||
|
|
||
| pipeline: | ||
| - gm4.plugins.extend.module | ||
|
|
||
| meta: | ||
| gm4: | ||
| versioning: | ||
| schedule_loops: [main] | ||
| website: | ||
| description: Decorated Pots and Flower Pots extended to allow all kinds of things to be placed in them! Decorate in Style! | ||
| #recommended: | ||
| #- | ||
| notes: | ||
| - <add notes on version or incompatibilities?> | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| #modrinth: | ||
| #project_id: null | ||
| #smithed: | ||
| #pack_id: null | ||
| planetminecraft: | ||
| uid: null | ||
| video: null | ||
| wiki: null | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| credits: | ||
| Creator: | ||
| - runcows | ||
runcows marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Icon Design: | ||
| - <no idea> | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
29 changes: 29 additions & 0 deletions
29
gm4_blossoming_pots/data/gm4_blossoming_pots/advancement/interact_flower_pot.json
This file contains hidden or 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,29 @@ | ||
| { | ||
| "criteria": { | ||
| "use_pot": { | ||
| "conditions": { | ||
| "location": [ | ||
| { | ||
| "condition": "minecraft:location_check", | ||
| "predicate": { | ||
| "block": { | ||
| "blocks": [ | ||
| "minecraft:flower_pot" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "trigger": "minecraft:any_block_use" | ||
| } | ||
| }, | ||
| "requirements": [ | ||
| [ | ||
| "use_pot" | ||
| ] | ||
| ], | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "rewards": { | ||
| "function": "gm4_blossoming_pots:flower/as_player" | ||
| } | ||
| } | ||
27 changes: 27 additions & 0 deletions
27
gm4_blossoming_pots/data/gm4_blossoming_pots/advancement/interact_vanilla_flower_pot.json
This file contains hidden or 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,27 @@ | ||
| { | ||
| "criteria": { | ||
| "use_pot": { | ||
| "conditions": { | ||
| "location": [ | ||
| { | ||
| "condition": "minecraft:location_check", | ||
| "predicate": { | ||
| "block": { | ||
| "blocks": "#gm4_blossoming_pots:potted_plants" | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "trigger": "minecraft:any_block_use" | ||
| } | ||
| }, | ||
| "requirements": [ | ||
| [ | ||
| "use_pot" | ||
| ] | ||
| ], | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "rewards": { | ||
| "function": "gm4_blossoming_pots:flower/vanilla_pots/as_player" | ||
| } | ||
| } | ||
29 changes: 29 additions & 0 deletions
29
gm4_blossoming_pots/data/gm4_blossoming_pots/advancement/item_in_pot.json
This file contains hidden or 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,29 @@ | ||
| { | ||
| "criteria": { | ||
| "use_pot": { | ||
| "conditions": { | ||
| "location": [ | ||
| { | ||
| "condition": "minecraft:location_check", | ||
| "predicate": { | ||
| "block": { | ||
| "blocks": [ | ||
| "minecraft:decorated_pot" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "trigger": "minecraft:any_block_use" | ||
| } | ||
| }, | ||
| "requirements": [ | ||
| [ | ||
| "use_pot" | ||
| ] | ||
| ], | ||
runcows marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "rewards": { | ||
| "function": "gm4_blossoming_pots:decorated/as_player" | ||
| } | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/as_marker.mcfunction
This file contains hidden or 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,28 @@ | ||
| # Dispatch for operations concerning the decorated pots plants | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # run from decorated/as_player | ||
|
|
||
| # summon the required amount of block displays, without data | ||
| execute \ | ||
| unless entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.2] \ | ||
| run function gm4_blossoming_pots:decorated/summon/initialize with block ~ ~ ~ item | ||
|
|
||
| # if new block displays summoned, catch it up to count | ||
| execute if score @s gm4_blossoming_pots.summon_loop matches 0 \ | ||
| run function gm4_blossoming_pots:decorated/catch_up/initialize | ||
|
|
||
| # merge the data of the corresponding item amount variant with the block displays there | ||
| execute \ | ||
| if entity @e[type=minecraft:block_display,tag=gm4_blossoming_pots.display.decorated_pot,distance=..0.2] \ | ||
| run function gm4_blossoming_pots:decorated/merge/initialize with block ~ ~ ~ item | ||
|
|
||
| # if merge score 0, succesfully merged data, play sound? | ||
| # merge or summon? | ||
| # merge score 0 triggers every pot interact, not ideal | ||
| # summon score 0 triggers only on first summon, not ideal either, but better | ||
| # ideally, we would only play sound on successful CHANGE, and not on just right click | ||
| execute if score @s gm4_blossoming_pots.summon_loop matches 0 run function gm4_blossoming_pots:decorated/sound/find with block ~ ~ ~ item | ||
|
|
||
| # kill marker | ||
| kill @s |
14 changes: 14 additions & 0 deletions
14
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/as_player.mcfunction
This file contains hidden or 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,14 @@ | ||
| # Sets up raycast, then redirects to as_marker, then revokes advancement | ||
| # @s = player who interacted with a decorated pot | ||
| # at @s | ||
| # run from advancement gm4_blossoming_pots:item_in_pot | ||
|
|
||
| # Raycast for the pot (set up range and search) | ||
| # range is 6 blocks, don't know how to handle custom block interaction range... | ||
| scoreboard players set @s gm4_blossoming_pots.range 1200 | ||
| execute anchored eyes run function gm4_blossoming_pots:decorated/raycast/loop | ||
|
|
||
| execute as @e[type=minecraft:marker,sort=nearest,tag=gm4_blossoming_pots.temp.decorated_pot] at @s align xyz positioned ~.5 ~.5 ~.5 run function gm4_blossoming_pots:decorated/as_marker | ||
|
|
||
| # Reset advancement | ||
| advancement revoke @s only gm4_blossoming_pots:item_in_pot |
7 changes: 7 additions & 0 deletions
7
...lossoming_pots/data/gm4_blossoming_pots/function/decorated/catch_up/initialize.mcfunction
This file contains hidden or 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 @@ | ||
| # Intializes the loop for catching block display data up to current pot item count | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # run from decorated/as_marker | ||
|
|
||
| scoreboard players set @s gm4_blossoming_pots.catch_up_loop 0 | ||
| function gm4_blossoming_pots:decorated/catch_up/loop with block ~ ~ ~ item |
15 changes: 15 additions & 0 deletions
15
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/catch_up/loop.mcfunction
This file contains hidden or 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,15 @@ | ||
| # main loop for catching block display data up to current pot item count | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # with block ~ ~ ~ item | ||
| # run from decorated/catch_up/initialize | ||
|
|
||
| scoreboard players add @s gm4_blossoming_pots.catch_up_loop 1 | ||
|
|
||
| data modify storage gm4_blossoming_pots:decorated_pots temp.id set from block ~ ~ ~ item.id | ||
| execute store result storage gm4_blossoming_pots:decorated_pots temp.count int 1 run scoreboard players get @s gm4_blossoming_pots.catch_up_loop | ||
| $execute store result score @s gm4_blossoming_pots.merge_loop run data get storage gm4_blossoming_pots:decorated_pots $(id).display_count | ||
| function gm4_blossoming_pots:decorated/merge/loop | ||
|
|
||
| $execute unless score @s gm4_blossoming_pots.catch_up_loop matches $(count).. run function gm4_blossoming_pots:decorated/catch_up/loop with block ~ ~ ~ item | ||
| data remove storage gm4_blossoming_pots:decorated_pots temp |
7 changes: 7 additions & 0 deletions
7
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/merge/display.mcfunction
This file contains hidden or 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 @@ | ||
| # merges data of one block display with data from storage | ||
| # @s = a single block display | ||
| # at the center of the decorated pot, origin of the block display | ||
| # with storage gm4_blossoming_pots:decorated_pots temp | ||
| # run from decorated/merge/transfer | ||
|
|
||
| $data merge entity @s $(merge) |
21 changes: 21 additions & 0 deletions
21
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/merge/initialize.mcfunction
This file contains hidden or 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,21 @@ | ||
| # Intializes the loop for merging block display data | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # with block ~ ~ ~ item | ||
| # run from decorated/as_marker | ||
|
|
||
|
|
||
| # we'll need a loop function to iterate over the index in storage and the cooresponding tags of block displays within range of marker | ||
| # n -> 0 stop when 0 | ||
| $execute unless data storage gm4_blossoming_pots:decorated_pots $(id) run return 1 | ||
| # store pot data in temp | ||
| $data modify storage gm4_blossoming_pots:decorated_pots temp set value {id:"$(id)",count:$(count)} | ||
|
|
||
| # set score of marker to the display count of the item in the pot, (number of block displays to modify) | ||
| $execute store result score @s gm4_blossoming_pots.merge_loop run data get storage gm4_blossoming_pots:decorated_pots $(id).display_count | ||
|
|
||
| # now, the rotation is stored, the pot data is stored, the scoreboard is set up | ||
| function gm4_blossoming_pots:decorated/merge/loop | ||
|
|
||
| # clear temp | ||
| data remove storage gm4_blossoming_pots:decorated_pots temp |
17 changes: 17 additions & 0 deletions
17
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/merge/loop.mcfunction
This file contains hidden or 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,17 @@ | ||
| # main loop for merging block display data | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # run from decorated/merge/initialize | ||
| # run from this function... | ||
| # run from decorated/catch_up/loop | ||
|
|
||
| scoreboard players remove @s gm4_blossoming_pots.merge_loop 1 | ||
|
|
||
| # store the current score into storage | ||
| execute store result storage gm4_blossoming_pots:decorated_pots temp.number int 1 run scoreboard players get @s gm4_blossoming_pots.merge_loop | ||
|
|
||
| # merge block display data | ||
| function gm4_blossoming_pots:decorated/merge/transfer with storage gm4_blossoming_pots:decorated_pots temp | ||
|
|
||
| # if there are more block displays to merge data, run again | ||
| execute unless score @s gm4_blossoming_pots.merge_loop matches 0 run function gm4_blossoming_pots:decorated/merge/loop |
21 changes: 21 additions & 0 deletions
21
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/merge/transfer.mcfunction
This file contains hidden or 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,21 @@ | ||
| # transfer layer of a function using macros :( | ||
| # @s = temp marker inside decorated pot | ||
| # at @s align xyz positioned ~.5 ~.5 ~.5 | ||
| # with storage gm4_blossoming_pots:decorated_pots temp | ||
| # run from decorated/merge/loop | ||
|
|
||
|
|
||
|
|
||
| # we need to | ||
| # target select the right block display | ||
| # use temp.number for numbered tag | ||
| # limit=1,sort=nearest,distance=..0.2 | ||
| # data modify entity @s <PATH???> merge from storage gm4_blossoming_pots:decorated_pots $(temp.pot.id).$(temp.pot.count)[$(temp.number)] | ||
| # AAAAAA | ||
| # i have to go another function deeper | ||
|
|
||
| # bail out if there isnt anything to merge here | ||
| $execute unless data storage gm4_blossoming_pots:decorated_pots $(id).$(count) run return 1 | ||
|
|
||
| $data modify storage gm4_blossoming_pots:decorated_pots temp.merge set from storage gm4_blossoming_pots:decorated_pots $(id).$(count)[$(number)] | ||
| $execute as @n[tag=gm4_blossoming_pots.display.decorated_pot.$(number),distance=..0.2] run function gm4_blossoming_pots:decorated/merge/display with storage gm4_blossoming_pots:decorated_pots temp |
20 changes: 20 additions & 0 deletions
20
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/raycast/in_pot.mcfunction
This file contains hidden or 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,20 @@ | ||
| # checks if execution context is inside the decorated pots hit box | ||
| # @s = player who interacted with a decorated pot | ||
| # at @s anchored eyes, then marched forward 0.005 over and over. Complicated. | ||
| # run from decorated/raycast/loop | ||
|
|
||
| # early return if not dec pot | ||
| execute unless block ~ ~ ~ minecraft:decorated_pot run return fail | ||
|
|
||
| # summon marker for checking | ||
| summon minecraft:marker ~ ~ ~ {Tags:["gm4_blossoming_pots.temp.decorated_pot","smithed.strict","smithed.entity"],CustomName:'{"text":"gm4_blossoming_pots.temp_marker"}'} | ||
|
|
||
| # if temp marker in physical hit box, return 1 | ||
| # dxdydz all 0 bc of MC-123441. | ||
| execute as @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.1] \ | ||
| align xyz positioned ~0.062499 ~ ~0.062499 if entity @s[dx=0,dy=0,dz=0] at @s align xyz positioned ~-0.062499 ~ ~-0.062499 if entity @s[dx=0,dy=0,dz=0] \ | ||
| run return 1 | ||
|
|
||
| # else, kill marker, return fail | ||
| kill @e[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.1,sort=nearest] | ||
| return fail |
14 changes: 14 additions & 0 deletions
14
gm4_blossoming_pots/data/gm4_blossoming_pots/function/decorated/raycast/loop.mcfunction
This file contains hidden or 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,14 @@ | ||
| # main loop for raycasting for the decorated pot the player interacted with | ||
| # @s = player who interacted with a decorated pot | ||
| # at @s anchored eyes, then marched forward 0.005 over and over | ||
| # run from decorated/as_player | ||
| # run from this function... | ||
|
|
||
|
|
||
| # if current location is within the decorated pots hit box, summon a temp marker, set its data with the player rotation, and exit raycast | ||
| execute if function gm4_blossoming_pots:decorated/raycast/in_pot run return run function gm4_blossoming_pots:decorated/raycast/player_rotation | ||
|
|
||
| scoreboard players remove @s gm4_blossoming_pots.range 1 | ||
|
|
||
| # repeat until find decorated pot or out of range | ||
| execute if score @s gm4_blossoming_pots.range matches 1.. positioned ^ ^ ^0.005 run function gm4_blossoming_pots:decorated/raycast/loop |
13 changes: 13 additions & 0 deletions
13
...oming_pots/data/gm4_blossoming_pots/function/decorated/raycast/player_rotation.mcfunction
This file contains hidden or 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,13 @@ | ||
| # sets rotation data of the new temp marker from players | ||
| # @s = player who interacted with a decorated pot | ||
| # at @s anchored eyes, then marched forward 0.005 over and over. This should be in the same spot as the new temp marker | ||
| # run from decorated/raycast/loop | ||
|
|
||
| # player facing west | ||
| execute if entity @s[y_rotation=45..135] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:0}} | ||
| # player facing north | ||
| execute if entity @s[y_rotation=135..225] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:90}} | ||
| # player facing east | ||
| execute if entity @s[y_rotation=225..315] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:180}} | ||
| # player facing south | ||
| execute if entity @s[y_rotation=315..405] run return run data merge entity @n[type=minecraft:marker,tag=gm4_blossoming_pots.temp.decorated_pot,distance=..0.01] {data:{rotation:-90}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.