#アイテムに説明(?)をつけるにはどうすればいいですか
1 messages · Page 1 of 1 (latest)
どのような状態の時に説明文が着くように?
または どのような用途ですか?
こんな感じにカーソルを合わせると出てくる名前の下に書きたいです
そうですねぇ
詳しく教えてほしいです!!
ちなみに どんなアイテムとか
どんなタイミングで 説明文を書きたいんですか?
source.getComponent('inventory')?.container.getItem(source.selectedSlotIndex)?.setLore(["Lore名"]);
Lore(説明文)自体はこれで設定できます。
あとはアイテムを更新(置き換え)すれば反映されます
一応loot_tableでのやり方としては、behaviorフォルダ直下に"loot_tables"というフォルダを作って、その中のjsonファイルに
{
"pools": [
{
"rolls":1,
"entries": [
{
"type": "item",
"name": "minecraft:iron_ingot", //アイテムのID
"functions": [
{
"function": "set_lore",
"lore": ["ooooooo","aaaa"] //説明文
}
]
}
]
}
]
}
と書いてコマンドのlootで呼び出せます
今回のようなものなら ContainerSlot使うと楽そう
初耳!なんですかそれは?
https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server_1_12_0_beta.Container.html#getSlot
ContainerSlotは書き換えるとスロットに直に反映される
setとかしなくて良い