Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '[{"text":"チェストそのまま回収君","color":"green"}]'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['[{"text":"丁寧丁寧丁寧に"}]']
data modify storage asset:artifact Lore set value ['[{"text":"真下にある","color":"white"},{"translate":"block.minecraft.chest"},{"text":"を回収する","color":"white"}]','[{"text":"中にアイテムの入った","color":"white"},{"translate":"block.minecraft.chest"}]','[{"text":"または、","color":"white"},{"translate":"block.minecraft.shulker_box"},{"text":"などがある場合は回収できない","color":"white"}]','{"text":"丁寧丁寧丁寧に","color":"gray"}']
# 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション)
# data modify storage asset:artifact ConsumeItem.Item set value
# data modify storage asset:artifact ConsumeItem.Count set value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
data remove storage asset:temp Fail
execute if entity @s[tag=!CanUsed] run return fail

# チェストの中身を取得し、中にチェスト・シュルカーボックスがあれば回収できない
# チェストの中身を取得し、中にアイテム入りアイテムがあれば回収できない
# 失敗時、asset:temp blockを削除
data modify storage asset:temp block set from block ~ ~ ~
execute if function asset:artifact/0290.carefully_collector/trigger/2.check_condition/ban_items run data modify storage asset:temp Fail set value true
execute if data storage asset:temp {Fail:true} run tellraw @s [{"translate":"block.minecraft.chest","color":"red"},{"text":"または"},{"translate":"block.minecraft.shulker_box"},{"text":"が中に入っています"}]
execute if function asset:artifact/0290.carefully_collector/trigger/2.check_condition/is_nested run data modify storage asset:temp Fail set value true
execute if data storage asset:temp {Fail:true} run tellraw @s [{"text":"アイテムの入った","color":"red"},{"translate":"block.minecraft.chest"},{"text":"などが含まれています。"}]
execute if data storage asset:temp {Fail:true} run data remove storage asset:temp block
execute if data storage asset:temp {Fail:true} run tag @s remove CanUsed
data remove storage asset:temp Fail
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:artifact/0290.carefully_collector/trigger/2.check_condition/is_nested
#
#
#
# @within function asset:artifact/0290.carefully_collector/trigger/2.check_condition

# 中にアイテム入りアイテムはあるか?
execute if data storage asset:temp block.Items[].tag.BlockEntityTag.Items[0] run return 1

# 失敗
return 0
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,24 @@
function asset:artifact/common/use/auto

# ここから先は神器側の効果の処理を書く
# 判定
execute if block ~ ~ ~ chest run scoreboard players set @s Temporary 1
execute if block ~ ~ ~ trapped_chest run scoreboard players set @s Temporary 2
# summon
summon item ~ ~ ~ {Tags:[CarefullyCollect],Item:{id:"minecraft:barrier",Count:1b}}

# データ処理
# summon
summon item ~ ~ ~ {Tags:[CarefullyCollect],Item:{id:"minecraft:barrier",Count:1b}}

data modify storage asset:temp chest.Count set value 1b
data modify storage asset:temp chest.id set from storage asset:temp block.id
data modify storage asset:temp chest.tag.BlockEntityTag.Items set from storage asset:temp block.Items
data modify storage asset:temp chest.tag.BlockEntityTag.Lock set from storage asset:temp block.Lock
data modify storage asset:temp chest.tag.display.Name set from storage asset:temp block.CustomName
# //反映
data modify entity @e[type=item,tag=CarefullyCollect,distance=..0,limit=1] Item set from storage asset:temp chest
# データ処理
data modify storage asset:temp chest.Count set value 1b
data modify storage asset:temp chest.id set from storage asset:temp block.id
data modify storage asset:temp chest.tag.BlockEntityTag.Items set from storage asset:temp block.Items
data modify storage asset:temp chest.tag.BlockEntityTag.Lock set from storage asset:temp block.Lock
data modify storage asset:temp chest.tag.display.Name set from storage asset:temp block.CustomName
# //反映
data modify entity @e[type=item,tag=CarefullyCollect,distance=..0,limit=1] Item set from storage asset:temp chest

# 演出
execute align xyz positioned ~0.5 ~0.5 ~0.5 run particle dust 0.408 0.894 0.29 0.5 ~ ~ ~ 0.4 0.4 0.4 0 250 normal @a
playsound entity.arrow.hit_player player @a ~ ~ ~ 1 1.5 1
# 演出
execute align xyz positioned ~0.5 ~0.5 ~0.5 run particle dust 0.408 0.894 0.29 0.5 ~ ~ ~ 0.4 0.4 0.4 0 250 normal @a
playsound entity.arrow.hit_player player @a ~ ~ ~ 1 1.5 1

# リセット
setblock ~ ~ ~ air
scoreboard players reset @s Temporary
data remove storage asset:temp chest
tag @e[type=item,tag=CarefullyCollect,distance=..0] remove CarefullyCollect
# リセット
setblock ~ ~ ~ air
data remove storage asset:temp chest
tag @e[type=item,tag=CarefullyCollect,distance=..0] remove CarefullyCollect