llynxfyre
Members-
Posts
14 -
Joined
-
Last visited
Everything posted by llynxfyre
-
How to get player position on an axis in 1.17.1
llynxfyre replied to llynxfyre's topic in Modder Support
doing minecraft.getinstance().player.position().y shows a warning of Resource leak: '<unassigned Closeable value>' is not closed at this location. What does getinstance.player actually do? -
How to get player position on an axis in 1.17.1
llynxfyre replied to llynxfyre's topic in Modder Support
Is playing music a client event -
How to get player position on an axis in 1.17.1
llynxfyre replied to llynxfyre's topic in Modder Support
I couldn't find what i needed to import to use getposition() -
How to get player position on an axis in 1.17.1
llynxfyre replied to llynxfyre's topic in Modder Support
@SubscribeEvent public void whenGameMusicPlays(final PlaySoundEvent event) { if (event.getName().equals("music.game") && ) { ResourceLocation loc = new ResourceLocation(CaveMusic.MODID + ":" + "music.overworld.underground"); SimpleSoundInstance MyPSR = new SimpleSoundInstance( loc, SoundSource.MUSIC, 1.0f, 1.0f, false, 0, SoundInstance.Attenuation.NONE, 0.0D, 0.0D, 0.0D, true); event.setResultSound(MyPSR); essentially i tried a few combinations of vec3i, vec3, Player and getY() after the &&. I was essentially throwing spaghetti at the wall because i didn't know what i needed to use in 1.17.1. I want to be able to test if player's position on the Y axis is less than a certain value. I'm really sorry if this is a stupid question. -
Hello, I know I've been quite active here lately and I promise I'll get out of your hair once i can work out this final thing. Essentially I'm looking for a way to get the player's Position on a specific axis and use its value in an if statement. I've experimented with classes vec3 and vec3i as the method getY() seemed promising, but i didn't know how to use it with the player and I had issues with the method being non-static. Any help would be appreciated.
-
Alright, I did what i wanted to do with my code, thank you so much for you patience with helping me. i just thought i'd post the code i wrote in case other people go looking for the same answers i was if (event.getName().equals("music.game")) { ResourceLocation loc = new ResourceLocation(CaveMusic.MODID + ":" + "music.overworld.underground"); SimpleSoundInstance MyPSR = new SimpleSoundInstance( loc, SoundSource.MUSIC, 1.0f, 1.0f, false, 0, SoundInstance.Attenuation.NONE, 0.0D, 0.0D, 0.0D, true); event.setResultSound(MyPSR); }
-
what does the hashtags mean
-
Installed forge, failing to load with 403 errors
llynxfyre replied to Jax22's topic in Support & Bug Reports
can you get any useful info from your crash reports? -
Ok, so, that's really helpful. I guess i need to learn how to make a custom sound instance for my sound.
-
(SOLVED)[1.12.2] Help with PlaySoundEvent
llynxfyre replied to kingdadrules's topic in Modder Support
what is the 1.17.1 equivalent of PositionedSoundRecord -
Is it ok if i ask what that is?
-
@SubscribeEvent public static void whenGameMusicPlays(final PlaySoundEvent event) { if (event.getName().equals("music.game")) { event.setResultSound(null); } this is the code that i have so far. I'm essentially looking for what i need to put in the field that currently says null. Can I put the sound event i made in there?
-
Hi, I'm quite new to modding and I'm trying to use event.setResultSound to play some custom music under certain conditions in place of music.game. All the examples I've seen of this being used involve a variable or something called ISound. I'm not sure what it is and my ide doesn't recognize it as being a part of forge or minecraft. How do I use this method? Is it even appropriate for what i wish to do? Like i said before, I'm very new to modding and an explanation would be super helpful for my learning process.
-
Is there a way to just get the player position on one axis?