'SoundInstance' is abstract; cannot be instantiated
Hi, I've been trying to make a minecraft mod that plays an audio file when I'm idle, and since I don't know anything about coding, and don't enough braincells to learn (trust me, I've tried a couple times), I've had to use AI.
14 hours later, and 100 something errors fixed, I'm left with a single one neither the AI or I can figure out.
'SoundInstance' is abstract; cannot be instantiated
Have tried using SimpleSoundInstance, but didn't work.
If anyone could help me figure out how to make it not abstract, it would be very appreciated.
44 Replies
⌛
This post has been reserved for your question.
Hey @Vemo! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
You can’t get instance of an abstract class. From that error the SoundInstance class is an abstract class.
You can only make subclasses of abstract classes I believe so extends SoundInstance
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
what if
Hi, I can do this.
If you're willing to help, I can send ya $20 as thanks.
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
at which line do you get that error

my bad didnt see it lol
You're good
check if
works any better
or did you try that already
you showed that theres an import for it

and so what was the error
when you used that
same thing again
or was it some different error
The import isn't being recognized, so I get these errors on the lines SimpleSoundInstance is mentioned

whats your minecraft version
1.21.4
hmmm
can you show which classes you get when you
click this
ctrl + click
duh
dumb formatting

no no
i didnt mean to paste that line
lol
just wanted to show which part to click
if you got
import net.minecraft.client.sound.SoundInstance;
click sound
Bear with me lol, I'm way out of my depth here
absolutely no worries
also what loader do you use
or whatever thats called for minecraft
Fabric, when I ctrl click sound this opens up on the side

and is SimpleSoundInstance inside the sound folder
or no
It's not
can you send a screenshot of whats there
cuz i only see 3 classes rn
Sure, 1 min. Might have to be more than 1 screenshot tho
ok


ok you dont have to send more
1 sec let me check the docs
try this


add this next to other imports
I think that did it. Build was successful atleast
🙀
shocking right
also make sure this is for client side
because it wont work for server side
Yeah ofc. This is meant for just me
You have no idea how long I sat with chatgpt going in circles lmao. Thank you. What's your paypal?
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
why would you need my paypal

well
im not lucia
thus i dont want money
ez
Ye but still yk. But alright, well, thank you so much
heres a crazy gif
That's the extent of my coding knowledge lmao
Post Closed
This post has been closed by <@168008947880558593>.