Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
For the Love of God Would You Shut Up

For the Love of God Would You Shut Up

Reverts the change made in 22w13a where noteblocks make sound even when there is a block ontop of them.

163
7
Utility
For the Love of God Would You Shut Up has been archived. For the Love of God Would You Shut Up will not receive any further updates unless the author decides to unarchive the project.
AboutChangelogVersions

the change that prompted the creation of this mod has been reverted

Changes in 22w15a

A previous change to Noteblocks that only Wool and Wool Carpets would block the sounds has been reverted

icon

For the Love of God Would You Shut Up

Reverts the change made in 22w13a where noteblocks make sound even when there is a block ontop of them.

This mod seeks to make redstone less annoying, it disables sounds from noteblocks when there is something ontop of them.

Note Blocks will still notify allay/sculk despite not making a sound.

Video

Code Change explained

Originally, the code for playing a note looked like this:

private void playNote(World world, BlockPos pos) {
    if (world.getBlockState(pos.up()).isAir()) {
        world.addSyncedBlockEvent(pos, this, 0, 0); // plays sound
    }
}

22w13a added a GameEvent for noteblocks being played and made it so noteblocks are only disabled if they have wool or carpet ontop of them

private void playNote(@Nullable Entity entity, World world, BlockPos pos) {
    BlockState blockState = world.getBlockState(pos.up());
    if (blockState.isIn(BlockTags.WOOL) || blockState.isIn(BlockTags.WOOL_CARPETS)) {
        return;
    }
    world.addSyncedBlockEvent(pos, this, 0, 0); // plays sound
    world.emitGameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos); // notifies allay, warden, and skulk sensors
}

This mod makes the following changes to that code*
*it actually turns world.addSyncedBlockEvent into a method that has the if statement

private void playNote(@Nullable Entity entity, World world, BlockPos pos) {
    BlockState blockState = world.getBlockState(pos.up());
    if (blockState.isIn(BlockTags.WOOL) || blockState.isIn(BlockTags.WOOL_CARPETS)) {
        return;
    }
+   if (world.getBlockState(pos.up()).isAir()) {
+       world.addSyncedBlockEvent(pos, this, 0, 0); // plays sound
+   }
-   world.addSyncedBlockEvent(pos, this, 0, 0);
    world.emitGameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, pos); // notifies allay, warden, and skulk sensors
}

Because this mod only seeks to make redstone less annoying, it just disables sounds from noteblocks when there is something ontop of them.

The functionality for notifying allay/sculk remains intact.

License

This project is under the Unlicense

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Compatibility

Minecraft: Java Edition

22w14a
22w13a

Platforms

Fabric

Supported environments

Server-side

Links

Report issues View source
Donate on Ko-fi

Creators

CassieNya
CassieNya Owner

Details

Licensed Unlicense
Published 3 years ago
Updated 3 years ago

Modrinth is open source.

main@9fd0f68

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.