Skip to content

Commit

Permalink
#300 ピクニックのときの先払い復元機の復元時動作を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
NePonpon committed Apr 21, 2024
1 parent cbaaf36 commit 9d3c7b6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
11 changes: 7 additions & 4 deletions data/skill/functions/act/common/restore_item/restore/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ function #oh_my_dat:please
data modify storage tusb_player: RestoreItem set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].RestoreItemData[-1]
data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].RestoreItemData[-1]

#復活地点調整 AnywhereTeleport処理を利用
data modify storage anywhere: at set from storage tusb_player: RestoreItem.RaisePoint
execute at @s run function #anywhere:tp

# ピクニック時所持してたアイテムを落とす
execute if data storage main: difficult{world:"picnic"} at @s run function skill:act/common/restore_item/restore/picnic/

# オフハンド
data remove storage item: Item
data modify storage item: Item set from storage tusb_player: RestoreItem.Items[{Slot:-106b}]
Expand Down Expand Up @@ -71,9 +78,5 @@ loot replace entity @s inventory.0 27 mine 2 2 2 debug_stick

execute unless data storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].RestoreItemData[-1] run tag @s remove HasRestoreItems

#復活地点調整 AnywhereTeleport処理を利用
data modify storage anywhere: at set from storage tusb_player: RestoreItem.RaisePoint
execute at @s run function #anywhere:tp

tellraw @s {"translate":"インベントリと位置情報を復元しました。","color":"green"}
execute at @s run function makeup:skill/act/common/restore_item/return
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ピクニックのとき、生前持っていたアイテムはその場に返却
data modify storage item: Items set from entity @s Inventory
data remove storage item: Items[].Slot
function skill:act/common/restore_item/restore/picnic/loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

summon item ~ ~ ~ {Tags:[Initializing],PickupDelay:0s,Item:{id:"minecraft:stone",Count:1b}}
data modify entity @e[tag=Initializing,distance=0,limit=1] Item set from storage item: Items[-1]
tag @e[distance=0,tag=Initializing] remove Initializing
data remove storage item: Items[-1]

execute if data storage item: Items[-1] run function skill:act/common/restore_item/restore/picnic/loop

0 comments on commit 9d3c7b6

Please sign in to comment.