Skip to content

Commit

Permalink
rx: changed to player tick file
Browse files Browse the repository at this point in the history
  • Loading branch information
RitikShah committed Oct 9, 2020
1 parent e93754b commit 0fd21e7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
9 changes: 0 additions & 9 deletions data/rx.ec/functions/gui.mcfunction

This file was deleted.

2 changes: 2 additions & 0 deletions data/rx.ec/functions/gui/fix.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ execute unless data storage rx:io playerdb.player run function rx.playerdb:api/g
data modify block -30000000 0 1602 Items set from entity @s EnderItems
function rx.ec:gui/icons
loot replace entity @s enderchest.0 mine -30000000 0 1602 air{drop_contents:1b}

scoreboard players set @s rx.ec.headDrop 0
16 changes: 16 additions & 0 deletions data/rx.ec/functions/player.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# By: rx97
# 4 Oct 2020
#
#> @s: player from rx.ec:tick
#> player tick

# setup
execute if entity @s[scores={rx.ec.openChest=1}] run function rx.ec:setup

# gui detect
execute store result score $items rx.temp run clear @s #rx:all{rx:{ec:{gui:1b}}} 0
execute if score $items rx.temp matches 1.. run function rx.ec:gui/root
clear @s #rx:all{rx:{ec:{gui:1b}}}

# head drop fix
execute if entity @s[scores={rx.ec.headDrop=1..}] run function rx.ec:gui/fix
8 changes: 4 additions & 4 deletions data/rx.ec/functions/tick.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#
#> #minecraft:tick

execute as @a[scores={rx.ec.openChest=1}] run function rx.ec:setup
execute as @a run function rx.ec:gui
execute as @a[scores={rx.ec.headDrop=1..}] run function rx.ec:gui/fix
#> player tick
execute as @a run function rx.ec:player

#> kill thrown GUI items
kill @e[type=item,nbt={Item:{tag:{rx:{ec:{gui:1b}}}}}]
scoreboard players set @a rx.ec.headDrop 0

0 comments on commit 0fd21e7

Please sign in to comment.