Skip to content

Commit bcd2fd8

Browse files
committed
Make gametime cherck more concise
1 parent fa03623 commit bcd2fd8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

gm4_furniture/data/gm4_furniture/function/interact/process.mcfunction

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
# at @s
44
# run from interact/detect
55

6-
# fail if different gametime
6+
# store time to check
77
execute store result score $gametime gm4_furniture_data run time query gametime
88
execute store result score $check_gametime gm4_furniture_data run data get entity @s interaction.timestamp 1
9-
execute unless score $gametime gm4_furniture_data = $check_gametime gm4_furniture_data run return run data remove entity @s interaction
109

1110
# clean
1211
data remove entity @s interaction
1312

13+
# fail if old interaction
14+
execute unless score $gametime gm4_furniture_data = $check_gametime gm4_furniture_data run return fail
15+
16+
# store interaction id
1417
scoreboard players operation $check_id gm4_furniture_id = @s gm4_furniture_id
1518

1619
# first successful interaction will be used, any lower down this list will be ignored

0 commit comments

Comments
 (0)