Jump to content

import cannot be resolved


Demon Llama

Recommended Posts

Hi I'm new to minecraft programming. Working through a book called "Minecraft modding with Forge" and got stuck.

 

I'm not sure why I am unable to import these classes.

 

Why am I getting these errors? Thanks a bunch :)

min.png

Edited by Demon Llama
Link to comment
Share on other sites

Welcome!

A few important things. 
1) It's best if you use the code quotations tool in the forum or use Pastebin to show us the code. 
2) It's super helpful if you let us know what version you are running. It also does not work with me and the reason is there isn't a ChatComponentText in the Util's as far as I can see. Probably it was moved to a different name/function. 

 

My guess is that you'll need to find updated code for this particular portion. I see a "ChatAllowedCharacters" but thats it for chat under the Util's hierarchy. Sorry. Thats the best I can do for you :(. Hopefully someone smarter has a better idea!

  • Like 1
Link to comment
Share on other sites

3 minutes ago, olrustyeye said:

Welcome!

A few important things. 
1) It's best if you use the code quotations tool in the forum or use Pastebin to show us the code. 
2) It's super helpful if you let us know what version you are running. It also does not work with me and the reason is there isn't a ChatComponentText in the Util's as far as I can see. Probably it was moved to a different name/function. 

 

My guess is that you'll need to find updated code for this particular portion. I see a "ChatAllowedCharacters" but thats it for chat under the Util's hierarchy. Sorry. Thats the best I can do for you :(. Hopefully someone smarter has a better idea!

Awwww. Thanks though. And thanks for the forum tips :D

 

Where can I find a documentation list for the Minecraft/Forge methods, events, classes, etc?

 

Thanks again!

Link to comment
Share on other sites

17 minutes ago, Demon Llama said:

Awwww. Thanks though. And thanks for the forum tips :D

 

Where can I find a documentation list for the Minecraft/Forge methods, events, classes, etc?

 

Thanks again!

I wish there was more documentation. Sadly it's severly lacking. Not for forge's lack of trying but things change so much and few people actually want to go through the code and find things. 
That being said there is some pretty useful stuff here. 
https://mcforge.readthedocs.io/en/latest/
Nothing like what you're looking for but it's a good resource for what is there. 

Link to comment
Share on other sites

2 minutes ago, olrustyeye said:

I wish there was more documentation. Sadly it's severly lacking. Not for forge's lack of trying but things change so much and few people actually want to go through the code and find things. 
That being said there is some pretty useful stuff here. 
https://mcforge.readthedocs.io/en/latest/
Nothing like what you're looking for but it's a good resource for what is there. 

Ah thanks. I actually looked through all that and couldn't find enough info :/ 

Compared to bukkit, it's a lot less documentation. Darn I really wanted to work through this awesome book too D: 

Link to comment
Share on other sites

2 minutes ago, Demon Llama said:

Ah thanks. I actually looked through all that and couldn't find enough info :/ 

Compared to bukkit, it's a lot less documentation. Darn I really wanted to work through this awesome book too D: 

I modded minecraft back in 1.3 and 1.5. Fun fact I actually owned the One Stop Mod Shop way way long ago haha. Things have changed, but the syntax on the basic stuff like blocks are the same. Find what version the book is using and switch to that go through it and then all you'll need to do is update your syntax!

 

Link to comment
Share on other sites

2 minutes ago, olrustyeye said:

I modded minecraft back in 1.3 and 1.5. Fun fact I actually owned the One Stop Mod Shop way way long ago haha. Things have changed, but the syntax on the basic stuff like blocks are the same. Find what version the book is using and switch to that go through it and then all you'll need to do is update your syntax!

 

OMG !!!!!! Great idea. Why didn't I think to downgrade so I could complete the book ? Haha.

Okay I will do that :D 

I'm super happy now !

Now to figure out how to undo everything and downgrade the forge version O.o

Link to comment
Share on other sites

https://pastebin.com/t7wP7RW4

 

Okay I'm not sure how to downgrade :/

I redid the whole forge folder and workspace and everything.

But now when I run ./gradlew setupDecompWorkspace, the build always fails.

 

Could someone help me out with how to go about properly downgrading?

 

 

EDIT: fixed the problem. I just picked a different version of 1.8 and the set up worked fine :D

Edited by Demon Llama
fixed my problem
Link to comment
Share on other sites

"Chat" components were renamed to "Text" components in 1.9. ChatComponentText is now TextComponentString, EnumChatFormatting is now TextFormatting.

 

This issue tracker documents most renames in 1.8+.

 

You can also use MCPBot to find the current name of a field/method/parameter when you have its old name:

  • Use the findf/findm/findp commands with the old MCP (deobfuscated) name and the old Minecraft version to find the SRG (obfuscated) name.
  • Use the same command with the SRG name and the new Minecraft version (or omit the version argument for the current version) to find the current MCP name.
  • Alternatively, use the fh/mh/ph commands with the SRG name to display the name history instead of just the current name.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I think my save file was potentially corrupted (based on what I have been reading online). The world has loaded and saved perfectly fine for weeks. Today I added about 6 new mods and updated 3 mod libraries, and then encountered the following error: "Errors in currently selected data packs prevented the world from loading. You can either try to load it with only the vanilla data pack ("safe mode"), or go back to the title screen and fix it manually." I have tried changing to a newer Forge version, reverting the updated mods back to original versions, removing the new mods, removing and readding all mods, removing my world file and loading the forge profile and adding it back, renaming the level.dat_old file as level.dat... Nothing has worked yet. Forge loads fine and I don't want to risk trying to reload the world in "safe mode" in case I end up losing mod-related content. Not sure how that works. I am having trouble reading the output log to determine what is causing the error. Any advice is better than none!! Thank you!     Info: Minecraft 1.20.1 Forge 47.1.3 Mod list (includes which mods are disabled, newly added before this error, and any changes I found after the error) : https://pastebin.com/nquXY1Hj Latest log: https://pastebin.com/U4fD0kAt
    • It all began with a chance encounter with a testimonial shared by Olivia, a fellow traveler on the winding road of cryptocurrency. Her words spoke of a miraculous recovery orchestrated by Wizard Web Recovery, a beacon of hope in the murky waters of online fraud. Intrigued by her story, I reached out to Wizard Web Recovery, hoping they could work their magic on my blocked crypto recovery. With bated breath, I shared my plight, providing evidence of my dilemma and praying for a solution. To my astonishment, a prompt response came, swift and reassuring. Wizard Web Recovery wasted no time in assessing my situation, guiding me through the process with patience and expertise. and then like a ray of sunshine breaking through the clouds, came the news I had longed for – a new private key had been generated, restoring my precious bitcoins. It was a moment of jubilation, a triumph over adversity that filled me with newfound hope. At that moment, I realized the true power of Wizard Web Recovery, not just as skilled technicians, but as guardians of trust in the digital realm. With their assistance, I reclaimed what was rightfully mine, turning despair into determination and paving the way for a brighter future. But their capabilities did not end there. Delving deeper into their expertise, I discovered that Wizard Web Recovery possessed a wealth of knowledge in reclaiming lost stolen cryptocurrency, and even exposing fraudulent investment schemes. So to all those who find themselves entangled in the web of online fraud, take heart. With the guidance of Wizard Web Recovery, there is a path to redemption.     Write Mail; ( Wizard webrecovery AT  vprogrammer. net ) 
    • It all began with a chance encounter with a testimonial shared by Olivia, a fellow traveler on the winding road of cryptocurrency. Her words spoke of a miraculous recovery orchestrated by Wizard Web Recovery, a beacon of hope in the murky waters of online fraud. Intrigued by her story, I reached out to Wizard Web Recovery, hoping they could work their magic on my blocked crypto recovery. With bated breath, I shared my plight, providing evidence of my dilemma and praying for a solution. To my astonishment, a prompt response came, swift and reassuring. Wizard Web Recovery wasted no time in assessing my situation, guiding me through the process with patience and expertise. and then like a ray of sunshine breaking through the clouds, came the news I had longed for – a new private key had been generated, restoring my precious bitcoins. It was a moment of jubilation, a triumph over adversity that filled me with newfound hope. At that moment, I realized the true power of Wizard Web Recovery, not just as skilled technicians, but as guardians of trust in the digital realm. With their assistance, I reclaimed what was rightfully mine, turning despair into determination and paving the way for a brighter future. But their capabilities did not end there. Delving deeper into their expertise, I discovered that Wizard Web Recovery possessed a wealth of knowledge in reclaiming lost stolen cryptocurrency, and even exposing fraudulent investment schemes. So to all those who find themselves entangled in the web of online fraud, take heart. With the guidance of Wizard Web Recovery, there is a path to redemption.    
    • How can I add drops when killing an entity? Now there are no drops. How can I add an @override to change the attack speed to 1.6 and show "when in main hand...attack damage,...attack speed"? also, how can I make the item enchantable? 
    • Ok. Thanks. by the way, will this crash in any circumstances? public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) { if (entity instanceof LivingEntity){ LivingEntity victim = (LivingEntity) entity; if(!victim.isDeadOrDying() && victim.getHealth()>0){ victim.setHealth(0); return true; } } return false; }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.