by Hira04 » 2020年4月05日(日) 14:42
自己解決しました
他で悩んでいる方がいた場合のため解決方法を載せておきます
コード: 全て選択
{
"display":{
"title":"被ダメテスト(vsプレイヤー)",
"description":"石プレイヤーから被ダメ\nName指定:test",
"icon":{
"item":"minecraft:stone"
}
},
"parent":"testspace:test_ad/test_root",
"criteria":{
"test_test":{
"trigger":"minecraft:entity_hurt_player",
"conditions":{
"damage":{
"source_entity": {
"type":"minecraft:player",
"equipment":{
"mainhand":{
"item":"minecraft:stone",
"nbt":"{display:{Name:\"{\\\"text\\\":\\\"test\\\"}\"}}"
}
}
}
}
}
}
}
}
失敗時は"nbt":"{tag:{display:{略}}}"や"nbt":"tag:{display:{略}}"としていたのですが、clearコマンドで対象を指定する際の書き方を考えたらおかしいことにすぐ気づくべきでした…
自己解決しました
他で悩んでいる方がいた場合のため解決方法を載せておきます
[spoiler=実績被ダメージアイテム名前指定]
[code]
{
"display":{
"title":"被ダメテスト(vsプレイヤー)",
"description":"石プレイヤーから被ダメ\nName指定:test",
"icon":{
"item":"minecraft:stone"
}
},
"parent":"testspace:test_ad/test_root",
"criteria":{
"test_test":{
"trigger":"minecraft:entity_hurt_player",
"conditions":{
"damage":{
"source_entity": {
"type":"minecraft:player",
"equipment":{
"mainhand":{
"item":"minecraft:stone",
"nbt":"{display:{Name:\"{\\\"text\\\":\\\"test\\\"}\"}}"
}
}
}
}
}
}
}
}
[/code]
[/spoiler]
失敗時は"nbt":"{tag:{display:{略}}}"や"nbt":"tag:{display:{略}}"としていたのですが、clearコマンドで対象を指定する際の書き方を考えたらおかしいことにすぐ気づくべきでした…