Arbiwreist
มือใหม่หัดคราฟต์
คือผมก็ลองใช้การ
execute as @e[type=item] at @s store result score @s numofitem run data get entity @s Item.Count
เพื่อการนับ scoreboard ของ entity นั้นๆ โดยที่นี้ใช้การนับ Items เป็นหลัก
หลังจากนั้นก็มีการเช็คที่ entity นั้นแล้วจึง summon armorstand ออกมาแล้วรันคำสั่ง
execute as @e[tag=itemcount] at @s run data merge entity @s {CustomName:"[{\"score\":{\"name\":\"@e[type=item,sort=nearest,distance=..1,limit=1]\",\"objective\":\"numofitem\"},\"color\":\"gold\"},{\"text\":\"x Items\"}]",CustomNameVisible:1b}
ดังข้างต้น ที่ที่ตัว armorstand ไม่แสดงค่า scoreboard ออกมามีแค่คำว่า "x Items"
ปล. ถ้าใช้การ tellraw ละนำ json text นี้มาใส่จะแสดงค่าออกมาตามปกติอย่าง "23x Items"
execute as @e[type=item] at @s store result score @s numofitem run data get entity @s Item.Count
เพื่อการนับ scoreboard ของ entity นั้นๆ โดยที่นี้ใช้การนับ Items เป็นหลัก
หลังจากนั้นก็มีการเช็คที่ entity นั้นแล้วจึง summon armorstand ออกมาแล้วรันคำสั่ง
execute as @e[tag=itemcount] at @s run data merge entity @s {CustomName:"[{\"score\":{\"name\":\"@e[type=item,sort=nearest,distance=..1,limit=1]\",\"objective\":\"numofitem\"},\"color\":\"gold\"},{\"text\":\"x Items\"}]",CustomNameVisible:1b}
ดังข้างต้น ที่ที่ตัว armorstand ไม่แสดงค่า scoreboard ออกมามีแค่คำว่า "x Items"
ปล. ถ้าใช้การ tellraw ละนำ json text นี้มาใส่จะแสดงค่าออกมาตามปกติอย่าง "23x Items"