Skip to content

Commit

Permalink
Added system to return utility items to a player if they lose them
Browse files Browse the repository at this point in the history
  • Loading branch information
brickmaster5001 committed Nov 2, 2023
1 parent 1d5e098 commit 2680d99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/lt/functions/main/tick_runner.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,8 @@ execute in tropicraft:tropics as @a[tag=building,tag=!given_tools,current_world=
execute in tropicraft:tropics run effect give @e[type=slime,tag=interact_blocker] invisibility infinite 1 true
execute in tropicraft:tropics run effect give @e[type=slime,tag=interact_blocker] regeneration infinite 50 true

# Spawn return items system.
execute in tropicraft:tropics as @a at @s if entity @e[type=marker,tag=utility.return_items_portal,distance=..0.85] run function lt:utility/return_items

# Scavenger Hunt
execute in tropicraft:tropics as @a[tag=!scavengerHunt01,current_world=true] run execute if data entity @s ForgeCaps.ltextras:collectibles.collectibles[].tag{title:"Clue 01"} run tag @s add scavengerHunt01
7 changes: 7 additions & 0 deletions data/lt/functions/utility/return_items.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
execute unless data entity @s Inventory[{id:"ltextras:tropical_map"}] run playsound minecraft:block.note_block.chime master @s ~ ~ ~ 1 1.2
execute unless data entity @s Inventory[{id:"ltextras:tropical_map"}] run tellraw @s {"translate":"lt.utility.spawn.return_item_message.collectible_basket","color":"yellow"}
execute unless data entity @s Inventory[{id:"ltextras:tropical_map"}] run function lt:collectible/give/utility/tropical_map

execute unless data entity @s Inventory[{id:"ltextras:collectible_basket"}] run playsound minecraft:block.note_block.chime master @s ~ ~ ~ 1 1.2
execute unless data entity @s Inventory[{id:"ltextras:collectible_basket"}] run tellraw @s {"translate":"lt.utility.spawn.return_item_message.tropical_map","color":"yellow"}
execute unless data entity @s Inventory[{id:"ltextras:collectible_basket"}] run function lt:collectible/give/utility/collectible_basket

0 comments on commit 2680d99

Please sign in to comment.