Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • createEntityByIDFromName error 1.12.2
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
richie995

createEntityByIDFromName error 1.12.2

By richie995, June 26, 2019 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

richie995    0

richie995

richie995    0

  • Tree Puncher
  • richie995
  • Members
  • 0
  • 4 posts
Posted June 26, 2019

I'm porting a mod from 1.10.2 to 1.12.2 and have received the following error NAME_TO_CLASS cannot be resolved or is not a field for the code

 
 
 
Spoiler

public void modifyDrops(final MobDropsInfo mobDrops) {
        if (!mobDrops.theEntity.world.isRemote) {
            int count = FileHelper.getCount(this.counts);
            while (count-- > 0) {
                final Entity entity = EntityList.NAME_TO_CLASS.(this.entityId, mobDrops.theEntity.world);
                if (entity == null) {
                    return;
                }
                this.initEntity(mobDrops.theEntity, entity, mobDrops);
                mobDrops.theEntity.world.spawnEntity(entity);

I know that NAME_TO_Class needs to be changed. I believe that it could be changed to createEntityByIDFromName, or getClassfromName, and these are suggestions I get when testing. However, When I switch to them it says I need a resource location, which I'm not sure how to create, fix, or what it means. This is one only a few errors left in the port, and would really appreciate a solution.

  • Quote

Share this post


Link to post
Share on other sites

Cadiboo    365

Cadiboo

Cadiboo    365

  • Reality Controller
  • Cadiboo
  • Members
  • 365
  • 3624 posts
Posted June 26, 2019

You should probably understand what that code is doing, and then port it differently. Without knowing what entitiyId or mobDrops.theEntity is, getClassFromName seems like the right replacement

  • Quote

About Me

Spoiler

My Discord - Cadiboo#8887

My Website - Cadiboo.github.io

My Mods - Cadiboo.github.io/projects

My Tutorials - Cadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      [1.16.5] Help with custom container (error when put a item in an slot)

      By diesieben07 · Posted just now

      Whata?
    • Centmap
      Forge Mods Folder

      By Centmap · Posted 42 minutes ago

      ok thanks  
    • Luis_ST
      [1.16.5] Help with custom container (error when put a item in an slot)

      By Luis_ST · Posted 49 minutes ago

      it was once intended for something else what do I have to change that I can use it
    • diesieben07
      [1.16.5] Help with custom container (error when put a item in an slot)

      By diesieben07 · Posted 52 minutes ago

      The IMessage interface is entirely unnecessary. Other than that, yes, that is how you add packets.
    • Luis_ST
      [1.16.5] Help with custom container (error when put a item in an slot)

      By Luis_ST · Posted 59 minutes ago

      yes I have this variable (it goes from 0 to 109).   this is what i'm trying right now. Edit: it works like this, but how do I find out when I have to move a slot outside of the visible area if I shouldn't use the slot's position   I've "tried" something like this before in another mod. But I am not sure whether it works that way and whether it is even right? code: PacketHandler: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/core/ModPacketHandler.java my message interface: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/core/IMessage.java SyncSlotPosition message (not final/ in work): https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/core/SyncSlotPosition.java   is there an error somewhere / does it work like that way?  
  • Topics

    • Luis_ST
      33
      [1.16.5] Help with custom container (error when put a item in an slot)

      By Luis_ST
      Started Tuesday at 11:15 PM

    • Centmap
      2
      Forge Mods Folder

      By Centmap
      Started 12 hours ago

    • yincrafter
      2
      CurseForge installer is stuck at Extracting files.

      By yincrafter
      Started 3 hours ago

    • dynastychan
      1
      anyone know why my forge 1.12.2 server is vanilla not modded?

      By dynastychan
      Started 11 hours ago

    • pitbox46
      1
      Pushing Redstone

      By pitbox46
      Started 5 hours ago

  • Who's Online (See full list)

    • Waterdev
    • than00ber1
    • VinGame
    • Centmap
    • Choonster
    • Luis_ST
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • createEntityByIDFromName error 1.12.2
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community