{id:MinecartCommandBlock,Command:/replaceitem entity @a[r=5] slot.hotbar.0 minecraft:bow 1 0 {ench:[],display:{Name:lightning_line,Lore:[发射一根普通箭矢就好]}}},{id:MinecartCommandBlock,Command:/replaceitem entity @a[r=5] slot.hotbar.1 minecraft:arrow 64 0 {ench:[],display:{Name:...
用if模式,不论data还是entity子模式都不方便替换物品,因为只单纯检测是否存在,而不指定替换物品的目标。如下指令,检测快捷栏第一格是否是命令方块,如果是,将背包第一格换为石头。execute as @a[nbt={Inventory:[{Slot:0b,id:"minecraft:command_block",Count:1b}]}] run item replace entity @s inventory.0...
Item Display (minecraft:item_display) Item frame (minecraft:item_frame) Lead (minecraft:leash_knot) Lightning bolt (minecraft:lightning_bolt)Example Summon lightning bolt Llama (minecraft:llama)Example (orNBT Tags) Summon llama Llama spit
"clickEvent":{"action":"show_item","value":"{id:'minecraft:emerald',tag:{display:{Name:'投币'}}}"} show_entity 悬停时显示实体信息 属性:实体单元 实体单元(我也不会):{type:命名空间,name:名字,id:UUID(随便)} E.G. "clickEvent":{"action":"show_entity","value":"{type:'minecraft:cre...
{"display":{"icon":{"item":"minecraft:carrot_on_a_stick","nbt":"{CustomModelData:12970010}"...
2. /give <player> <item> [amount] [data] [dataTag]:给予玩家物品,item参数可以是任何物品ID,amount参数是物品数量,data参数是物品数据值,dataTag参数是物品的NBT数据。 3. /tp <target> <destination>:传送到目标位置,target参数可以是玩家名或实体ID,destination参数可以是坐标或玩家名。
DisplaySlotId DyeColor EasingType EnchantmentSlot EntityComponentTypes EntityDamageCause EntityInitializationCause EquipmentSlot FluidType GameMode GameRule HudElement HudVisibility InputMode InputPermissionCategory ItemComponentTypes ItemLockMode MemoryTier MoonPhase ObjectiveSortOrder PaletteColor PlatformType Scoreboar...
shooter, if the executing entity is a projectile (like Arrow, Fireball, Trident, Firework, Thrown Potion, etc.) 可以是发射者,如果当前执行实体是一个弹射物(例如箭矢、火球、三叉戟、烟花火箭、投掷的药水等) thrower, if the executing entity is an item 可以是投掷者,如果当前执行实体是一个物品 sour...
import { EntityItemComponent, EntityComponentTypes, DimensionLocation } from "@minecraft/server"; function testThatEntityIsFeatherItem( log: (message: string, status?: number) => void, targetLocation: DimensionLocation ) { const items = targetLocation.dimension.getEntities({ location: targetLocation,...
//Event HandlerpublicclassMyForgeEventHandler{@SubscribeEventpublicvoidpickupItem(EntityItemPickupEvent event){System.out.println("Item picked up!");}} 这是一个非静态事件处理程序,表示当一个实体捡起一个物品的时候该程序被调用。 注册该 Event Handler 的方法是在构造方法中添加:MinecraftForge.EVENT_BUS...