Răsfoiți Sursa

测试物品获得

00ll00 6 ani în urmă
părinte
comite
ab3bcd0dff

+ 1 - 0
data/test/functions/check_item.mcfunction

@@ -0,0 +1 @@
+execute as @a if data entity @s Inventory[{"tag":{"ltw_item_new":1b}}] run function test:check_item_

+ 7 - 0
data/test/functions/check_item_.mcfunction

@@ -0,0 +1,7 @@
+setblock 8 12 2009 jukebox
+data modify block 8 12 2009 RecordItem set from entity @s Inventory[{"tag":{"ltw_item_new":1b}}]
+tellraw @a [{"selector": "@s"},{"text":"获得了道具:"},{"nbt": "RecordItem.tag.ltw_item_name","block": "8 12 2009","interpret": true}]
+data modify block 8 12 2009 RecordItem.tag.ltw_item_new set value 0b
+clear @s #test:items{"ltw_item_new":1b}
+fill 8 12 2009 8 12 2009 air destroy
+execute positioned 8 12 2009 run tp @e[type=item,sort=nearest,limit=1] ~ ~ ~

+ 1 - 0
data/test/functions/get_test_item.mcfunction

@@ -0,0 +1 @@
+summon item ~ ~ ~ {Item:{id:"fishing_rod",Count:1,tag:{"ltw_item":1b,"ltw_item_new":1b,"ltw_item_name":'{"text":"[破损的钓鱼竿]","color":"green"}'}},CustomName:'{"text":"破损的钓鱼竿","color":"green"}',Tags:["team_green"],Age:-32768,PickupDelay:32767,NoGravity:1,Invulnerable:1,CustomNameVisible:1,Glowing:1}

+ 0 - 0
data/test/tags/items/items.json