fix most (or all) missing block placement sounds

This commit is contained in:
ForestOfLight
2025-07-10 16:23:29 -07:00
Unverified
parent e53255acc8
commit 7cc2233545
2 changed files with 3663 additions and 6 deletions
+3 -6
View File
@@ -1,7 +1,7 @@
import { system, EntityComponentTypes, LiquidType } from '@minecraft/server';
import { FormCancelationReason } from '@minecraft/server-ui';
import { specialItemPlacementConversions } from './data';
import { blocks } from './blocks';
import { blocks, block_sounds } from './blocks';
export async function forceShow(player, form, timeout = Infinity) {
const startTick = system.currentTick;
@@ -62,10 +62,7 @@ function playBlockPlacementSound(player, block, structureBlock) {
const blockId = structureBlock.type.id.replace('minecraft:', '');
const blockData = blocks[blockId];
let blockSound = blockData['sound'] || 'stone';
if (['glass', 'terracotta'].includes(blockSound))
blockSound = 'stone';
let blockSoundId = 'dig.' + blockSound;
if (['iron', 'calcite'].includes(blockSound))
blockSoundId = 'place.' + blockSound;
let blockSoundId = block_sounds[blockSound].events.place?.sound
|| block_sounds[block_sounds[blockSound].base].events.place?.sound;
player.dimension.playSound(blockSoundId, block.location);
}