1
0

feat: 添加玩家模型方块

This commit is contained in:
2022-09-12 21:07:14 +08:00
parent bbb5ebc4d8
commit 71a596c897
6 changed files with 430 additions and 0 deletions
+41
View File
@@ -471,6 +471,47 @@ onEvent('block.registry', (event) => {
});
// 注册方块 - 其它
onEvent('block.registry', (event) => {
console.info(`${LOG_PREFIX} 注册方块 - 其它 - 开始`);
const blocks = [
{
name: 'statue_player_alex',
box: [4, 0, 6, 12, 31, 10, true],
label: '模型(Alex',
model: 'statue/player_alex',
},
{
name: 'statue_player_steve',
box: [4, 0, 6, 12, 31, 10, true],
label: '模型(Steve',
model: 'statue/player_steve',
},
];
blocks.forEach((config) => {
const id = `${MOD_ID}:${config.name}`;
const block = event.create(id, 'basic');
setBlockProps(block, {
boxConfig: config.box,
boxType: 'custom',
displayName: config.label,
isSolid: false,
material: 'stone',
modelPath: `${P_BLOCK}/${config.model}`,
renderType: 'cutout',
});
});
console.info(`${LOG_PREFIX} 注册方块 - 其它 - 完成`);
});
// 注册物品
// onEvent('item.registry', (event) => {
// console.info(`${LOG_PREFIX} 注册物品 - 开始`);