docs-test

ScriptAPI v1.20.60の主な変更点

公式のチェンジログ | npm

バージョンの更新

エンチャント関連の変更

ItemStackにエンチャントを付与する例:

1const enchantable = itemStack.getComponent("minecraft:enchantable");
2enchantable.addEnchantment({ type: "unbreaking", level: 3 });

ChatSendEventの変更

EntityProjectileComponent 追加

コンポーネントID: minecraft:projectile
ビヘイビア側で設定できるほぼ全ての値を変更できる

1const spawnLocation = Vector.add(player.getHeadLocation(), player.getViewDirection());
2const snowball = player.dimension.spawnEntity("minecraft:snowball", spawnLocation);
3const projectile = snowball.getComponent("minecraft:projectile");
4const velocity = Vector.multiply(player.getViewDirection(), 5);
5projectile.shoot(velocity);

PlayerPlaceBlockBeforeEvent

System

ItemStack Dynamic Property

アイテムにDynamicPropertyを保存できるようになった
それに伴いItemStackに関連メソッドが追加

その他


Edit on Github