net.minecraft.sound.SoundEvent Java Examples

The following examples show how to use net.minecraft.sound.SoundEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SkeletonEntityMixin.java    From the-hallow with MIT License 5 votes vote down vote up
@Inject(method = "getAmbientSound()Lnet/minecraft/sound/SoundEvent;", at = @At("RETURN"), cancellable = true)
protected void getAmbientSound(CallbackInfoReturnable<SoundEvent> cb) {
	//noinspection ConstantConditions
	if (((SkeletonEntity) (Object) this).getEquippedStack(EquipmentSlot.MAINHAND).getItem() == HallowedItems.TRUMPET) {
		cb.setReturnValue(HallowedSounds.DOOT);
	}
}
 
Example #2
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #3
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #4
Source File: NotebotUtils.java    From bleachhack-1.14 with GNU General Public License v3.0 5 votes vote down vote up
private static void play(SoundEvent sound, float pitch) {
	if (MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().player != null) {
		MinecraftClient.getInstance().world.playSound(MinecraftClient.getInstance().player,
				MinecraftClient.getInstance().player.getBlockPos(), sound, SoundCategory.RECORDS, 3.0F, pitch);
	} else {
		MinecraftClient.getInstance().getSoundManager().play(
				new PositionedSoundInstance(sound, SoundCategory.RECORDS, 3.0F, pitch, 0F, 0F, 0F));
	}
}
 
Example #5
Source File: VillagerProfession_wartFarmMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Inject(method = "register(Ljava/lang/String;Lnet/minecraft/world/poi/PointOfInterestType;Lnet/minecraft/sound/SoundEvent;)Lnet/minecraft/village/VillagerProfession;", cancellable = true, at = @At("HEAD"))
private static void registerCleric(String key, PointOfInterestType pointOfInterestType, SoundEvent soundEvent, CallbackInfoReturnable<VillagerProfession> cir)
{
    if (key.equals("cleric"))
    {
        cir.setReturnValue(register(key, pointOfInterestType, ImmutableSet.of(Items.NETHER_WART), ImmutableSet.of(Blocks.SOUL_SAND), soundEvent));
    }
}
 
Example #6
Source File: Protocol_1_14_4.java    From multiconnect with MIT License 5 votes vote down vote up
private void mutateSoundEventRegistry(ISimpleRegistry<SoundEvent> registry) {
    registry.unregister(SoundEvents.ENTITY_BEE_DEATH);
    registry.unregister(SoundEvents.ENTITY_BEE_HURT);
    registry.unregister(SoundEvents.ENTITY_BEE_LOOP_AGGRESSIVE);
    registry.unregister(SoundEvents.ENTITY_BEE_LOOP);
    registry.unregister(SoundEvents.ENTITY_BEE_STING);
    registry.unregister(SoundEvents.ENTITY_BEE_POLLINATE);
    registry.unregister(SoundEvents.BLOCK_BEEHIVE_DRIP);
    registry.unregister(SoundEvents.BLOCK_BEEHIVE_ENTER);
    registry.unregister(SoundEvents.BLOCK_BEEHIVE_EXIT);
    registry.unregister(SoundEvents.BLOCK_BEEHIVE_SHEAR);
    registry.unregister(SoundEvents.BLOCK_BEEHIVE_WORK);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_BREAK);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_FALL);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_HIT);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_PLACE);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_SLIDE);
    registry.unregister(SoundEvents.BLOCK_HONEY_BLOCK_STEP);
    registry.unregister(SoundEvents.ITEM_HONEY_BOTTLE_DRINK);
    registry.unregister(SoundEvents.ENTITY_IRON_GOLEM_DAMAGE);
    registry.unregister(SoundEvents.ENTITY_IRON_GOLEM_REPAIR);

    insertAfter(registry, SoundEvents.ENTITY_PARROT_IMITATE_ENDER_DRAGON, SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_ENDERMAN, "entity.parrot.imitate.enderman");
    insertAfter(registry, SoundEvents.ENTITY_PARROT_IMITATE_MAGMA_CUBE, SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_PANDA, "entity.parrot.imitate.panda");
    insertAfter(registry, SoundEvents.ENTITY_PARROT_IMITATE_PILLAGER, SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_POLAR_BEAR, "entity.parrot.imitate.polar_bear");
    insertAfter(registry, SoundEvents.ENTITY_PARROT_IMITATE_WITHER_SKELETON, SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_WOLF, "entity.parrot.imitate.wolf");
    insertAfter(registry, SoundEvents.ENTITY_PARROT_IMITATE_ZOMBIE, SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_ZOMBIE_PIGMAN, "entity.parrot.imitate.zombie_pigman");
}
 
Example #7
Source File: Protocol_1_10.java    From multiconnect with MIT License 5 votes vote down vote up
private void mutateSoundEventRegistry(ISimpleRegistry<SoundEvent> registry) {
    registry.unregister(SoundEvents.BLOCK_SHULKER_BOX_CLOSE);
    registry.unregister(SoundEvents.BLOCK_SHULKER_BOX_OPEN);
    registry.unregister(SoundEvents.ENTITY_ELDER_GUARDIAN_FLOP);
    registry.unregister(SoundEvents.ENTITY_EVOKER_FANGS_ATTACK);
    registry.unregister(SoundEvents.ENTITY_EVOKER_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_EVOKER_CAST_SPELL);
    registry.unregister(SoundEvents.ENTITY_EVOKER_DEATH);
    registry.unregister(SoundEvents.ENTITY_EVOKER_HURT);
    registry.unregister(SoundEvents.ENTITY_EVOKER_PREPARE_ATTACK);
    registry.unregister(SoundEvents.ENTITY_EVOKER_PREPARE_SUMMON);
    registry.unregister(SoundEvents.ENTITY_EVOKER_PREPARE_WOLOLO);
    registry.unregister(SoundEvents.ENTITY_LLAMA_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_LLAMA_ANGRY);
    registry.unregister(SoundEvents.ENTITY_LLAMA_CHEST);
    registry.unregister(SoundEvents.ENTITY_LLAMA_DEATH);
    registry.unregister(SoundEvents.ENTITY_LLAMA_EAT);
    registry.unregister(SoundEvents.ENTITY_LLAMA_HURT);
    registry.unregister(SoundEvents.ENTITY_LLAMA_SPIT);
    registry.unregister(SoundEvents.ENTITY_LLAMA_STEP);
    registry.unregister(SoundEvents.ENTITY_LLAMA_SWAG);
    registry.unregister(SoundEvents.ENTITY_MULE_CHEST);
    registry.unregister(SoundEvents.ENTITY_VEX_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_VEX_CHARGE);
    registry.unregister(SoundEvents.ENTITY_VEX_DEATH);
    registry.unregister(SoundEvents.ENTITY_VEX_HURT);
    registry.unregister(SoundEvents.ENTITY_VINDICATOR_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_VINDICATOR_DEATH);
    registry.unregister(SoundEvents.ENTITY_VINDICATOR_HURT);
    registry.unregister(SoundEvents.ITEM_ARMOR_EQUIP_ELYTRA);
    registry.unregister(SoundEvents.ITEM_BOTTLE_EMPTY);
    registry.unregister(SoundEvents.ITEM_TOTEM_USE);

    insertAfter(registry, SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundEvents_1_10.ENTITY_EXPERIENCE_ORB_TOUCH, "entity.experience_orb.touch");
}
 
Example #8
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Nullable
@Override
protected SoundEvent getAmbientSound() {
    return super.getAmbientSound();
}
 
Example #9
Source File: CrowEntity.java    From the-hallow with MIT License 4 votes vote down vote up
@Override
public SoundEvent getAmbientSound() {
	return HallowedSounds.CROW_AMBIENT;
}
 
Example #10
Source File: HallowedButtonBlock.java    From the-hallow with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getClickSound(boolean on) {
	if (wooden) return on ? SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_ON : SoundEvents.BLOCK_WOODEN_BUTTON_CLICK_OFF;
	else return on ? SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON : SoundEvents.BLOCK_STONE_BUTTON_CLICK_OFF;
}
 
Example #11
Source File: HallowedSounds.java    From the-hallow with MIT License 4 votes vote down vote up
private static SoundEvent register(String name) {
	return Registry.register(Registry.SOUND_EVENT, TheHallow.id(name), new SoundEvent(TheHallow.id(name)));
}
 
Example #12
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getDeathSound() {
    return super.getDeathSound();
}
 
Example #13
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
public SoundEvent getYesSound() {
    return super.getYesSound();
}
 
Example #14
Source File: Protocol_1_11_2.java    From multiconnect with MIT License 4 votes vote down vote up
private void mutateSoundEventRegistry(ISimpleRegistry<SoundEvent> registry) {
    registry.unregister(SoundEvents.ENTITY_BOAT_PADDLE_LAND);
    registry.unregister(SoundEvents.ENTITY_BOAT_PADDLE_WATER);
    registry.unregister(SoundEvents.ENTITY_FISHING_BOBBER_RETRIEVE);
    registry.unregister(SoundEvents.ENTITY_ENDER_EYE_DEATH);
    registry.unregister(SoundEvents.BLOCK_END_PORTAL_FRAME_FILL);
    registry.unregister(SoundEvents.BLOCK_END_PORTAL_SPAWN);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_CAST_SPELL);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_DEATH);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_HURT);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_MIRROR_MOVE);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_PREPARE_BLINDNESS);
    registry.unregister(SoundEvents.ENTITY_ILLUSIONER_PREPARE_MIRROR);
    registry.unregister(SoundEvents.BLOCK_NOTE_BLOCK_BELL);
    registry.unregister(SoundEvents.BLOCK_NOTE_BLOCK_CHIME);
    registry.unregister(SoundEvents.BLOCK_NOTE_BLOCK_FLUTE);
    registry.unregister(SoundEvents.BLOCK_NOTE_BLOCK_GUITAR);
    registry.unregister(SoundEvents.BLOCK_NOTE_BLOCK_XYLOPHONE);
    registry.unregister(SoundEvents.ENTITY_PARROT_AMBIENT);
    registry.unregister(SoundEvents.ENTITY_PARROT_DEATH);
    registry.unregister(SoundEvents.ENTITY_PARROT_EAT);
    registry.unregister(SoundEvents.ENTITY_PARROT_FLY);
    registry.unregister(SoundEvents.ENTITY_PARROT_HURT);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_BLAZE);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_CREEPER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ELDER_GUARDIAN);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ENDER_DRAGON);
    registry.unregister(SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_ENDERMAN);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ENDERMITE);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_EVOKER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_GHAST);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_HUSK);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ILLUSIONER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_MAGMA_CUBE);
    registry.unregister(SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_POLAR_BEAR);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_SHULKER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_SILVERFISH);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_SKELETON);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_SLIME);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_SPIDER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_STRAY);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_VEX);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_VINDICATOR);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_WITCH);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_WITHER);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_WITHER_SKELETON);
    registry.unregister(SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_WOLF);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ZOMBIE);
    registry.unregister(SoundEvents_1_14_4.ENTITY_PARROT_IMITATE_ZOMBIE_PIGMAN);
    registry.unregister(SoundEvents.ENTITY_PARROT_IMITATE_ZOMBIE_VILLAGER);
    registry.unregister(SoundEvents.ENTITY_PARROT_STEP);
    registry.unregister(SoundEvents.ENTITY_PLAYER_HURT_DROWN);
    registry.unregister(SoundEvents.ENTITY_PLAYER_HURT_ON_FIRE);
    registry.unregister(SoundEvents.UI_TOAST_IN);
    registry.unregister(SoundEvents.UI_TOAST_OUT);
    registry.unregister(SoundEvents.UI_TOAST_CHALLENGE_COMPLETE);
}
 
Example #15
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
public SoundEvent getEatSound(ItemStack stack) {
    return super.getEatSound(stack);
}
 
Example #16
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getTradingSound(boolean sold) {
    return super.getTradingSound(sold);
}
 
Example #17
Source File: MixinSoundEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public IForgeRegistryEntry<SoundEvent> setRegistryName(Identifier name) {
	this.registryName = name;

	return this;
}
 
Example #18
Source File: MixinSoundEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Identifier getRegistryName() {
	SoundEvent soundEvent = (SoundEvent) (Object) this;

	return Identifiers.getOrFallback(Registry.SOUND_EVENT, soundEvent, registryName);
}
 
Example #19
Source File: MixinSoundEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Class<SoundEvent> getRegistryType() {
	return SoundEvent.class;
}
 
Example #20
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getHurtSound(DamageSource source) {
    return super.getHurtSound(source);
}
 
Example #21
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getFallSound(int distance) {
    return super.getFallSound(distance);
}
 
Example #22
Source File: MoonVillagerEntity.java    From Galacticraft-Rewoven with MIT License 4 votes vote down vote up
@Override
protected SoundEvent getDrinkSound(ItemStack stack) {
    return super.getDrinkSound(stack);
}
 
Example #23
Source File: VillagerProfession_wartFarmMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 votes vote down vote up
@Shadow static VillagerProfession register(String string, PointOfInterestType pointOfInterestType, ImmutableSet<Item> immutableSet, ImmutableSet<Block> immutableSet2, /*@Nullable*/ SoundEvent soundEvent) {return null;}