Skip to content

Commit

Permalink
fix: sound issue #9 - no sound for sticking knife into soft blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed Jun 27, 2023
1 parent 2fa0b97 commit e6e024e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import net.minecraft.item.ItemStack
import net.minecraft.nbt.NbtCompound
import net.minecraft.server.world.ServerWorld
import net.minecraft.sound.SoundCategory
import net.minecraft.sound.SoundEvents
import net.minecraft.util.hit.BlockHitResult
import net.minecraft.util.hit.EntityHitResult
import net.minecraft.util.hit.HitResult
Expand Down Expand Up @@ -142,6 +143,7 @@ class ThrownKnifeEntity(type: EntityType<out Entity>, world: World) : Entity(typ
if (!this.isOnWall) {
this.isOnWall = true
this.setPosition(bhr.pos)
this.world.playSound(null, this.blockPos, SoundEvents.BLOCK_WOOD_PLACE, SoundCategory.BLOCKS, 0.3f, 1.0f)
}
} else {
this.drop()
Expand Down

0 comments on commit e6e024e

Please sign in to comment.