Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions gm4_calling_bell/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ data_pack:
pipeline:
- gm4.plugins.extend.module

require:
- bolt

meta:
gm4:
versioning:
schedule_loops:
- tick
- day_clock
schedule_loops: []
model_data:
- item: emerald
reference: gui/advancement/calling_bell
Expand All @@ -32,5 +33,7 @@ meta:
credits:
Creator:
- TheEpyonProject
Updated By:
- runcows
Icon Design:
- Hozz
24 changes: 24 additions & 0 deletions gm4_calling_bell/data/gm4_calling_bell/advancement/ring_bell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"criteria": {
"ringbell": {
"trigger": "minecraft:any_block_use",
"conditions": {
"location": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": "minecraft:emerald"
}
},
{
"condition": "minecraft:block_state_property",
"block": "minecraft:bell"
}
]
}
}
},
"rewards": {
"function": "gm4_calling_bell:on_bell_interact"
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
scoreboard objectives add gm4_calling_bell dummy
scoreboard objectives add gm4_calling_bell_rung minecraft.custom:minecraft.bell_ring

execute unless score calling_bell gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Calling Bell"}
execute unless score calling_bell gm4_earliest_version < calling_bell gm4_modules run scoreboard players operation calling_bell gm4_earliest_version = calling_bell gm4_modules
scoreboard players set calling_bell gm4_modules 1

schedule function gm4_calling_bell:tick 1t
schedule function gm4_calling_bell:day_clock 10t

#$moduleUpdateList
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @s = player who used an emerald on a bell
# at @s
# run from advancement: ring_bell

advancement revoke @s only gm4_calling_bell:ring_bell

# TODO: remove raw and bolt require later
# fail if player already used today
raw execute store result score $day gm4_calling_bell run time query day repetition
execute if score @s gm4_calling_bell = $day gm4_calling_bell run return run playsound entity.wandering_trader.no neutral @a[distance=..16] ~ ~ ~ 1 1 0.6

execute store result score $ray gm4_calling_bell run attribute @s minecraft:block_interaction_range get 10
execute anchored eyes positioned ^ ^ ^ run function gm4_calling_bell:raycast
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# @s = player right clicking bell with emerald
# at @s anchored eyes marched forward over and over
# run from gm4_calling_bell:on_bell_interact and self

scoreboard players remove $ray gm4_calling_bell 1

execute if block ~ ~ ~ bell align xyz positioned ~0.5 ~1 ~0.5 run return run function gm4_calling_bell:summon_trader

execute if score $ray gm4_calling_bell matches 1.. positioned ^ ^ ^0.1 run function gm4_calling_bell:raycast
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# summon a wandering trader for the player
# summon a wandering trader if valid placement
# @s = player right clicking bell with emerald
# above bell
# run from gm4_calling_bell:bell/ray/loop
# at block above bell
# run from raycast

# check for valid spawn placement, otherwise return
execute unless predicate gm4_calling_bell:trader_hitbox_no_collision run return run playsound entity.wandering_trader.no neutral @a[distance=..16] ~ ~ ~ 1 1 0.6

# summon trader
summon wandering_trader ~ ~ ~ {Tags:["gm4_calling_bell_trader"],DespawnDelay:24000}
particle happy_villager ~ ~0.5 ~ 0.3 0.3 0.3 1 5
playsound entity.wandering_trader.reappeared neutral @a[distance=..16] ~ ~ ~ 1 1 0.6
particle minecraft:large_smoke ~ ~1 ~ 0.25 0.5 0.25 0 10
particle happy_villager ~ ~0.5 ~ 0.3 0.3 0.3 1 5
particle large_smoke ~ ~1 ~ 0.25 0.5 0.25 0 10

# consume emerald
item modify entity @s[gamemode=!creative] weapon.mainhand gm4_calling_bell:minus_one
Expand Down

This file was deleted.

2 changes: 2 additions & 0 deletions gm4_calling_bell/data/gm4_calling_bell/test/call.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ setblock ~1 ~1 ~1 bell
execute at @s run tp @s ~ ~ ~ facing ~ ~-1 ~1
give @s emerald
dummy @s use block ~1.4 ~1.25 ~1.5 north
# any_block_use isnt triggering for dummy @s use block
advancement grant @s only gm4_calling_bell:ring_bell

await entity @e[type=wandering_trader,distance=..4]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ setblock ~1 ~3 ~1 stone
execute at @s run tp @s ~ ~ ~ facing ~ ~-1 ~1
give @s emerald
dummy @s use block ~1.4 ~1.25 ~1.5 north
# any_block_use isnt triggering for dummy @s use block
advancement grant @s only gm4_calling_bell:ring_bell

await delay 1s

Expand Down
Loading