Jump to content

Recommended Posts

Posted (edited)

My custom block is visible in the inventory, but when placed it is invisible. The texture is registering on some level, as it functions in the inventory, and when the block is broken the particles match the texture. The following are my JSON files for the blocks.

 

BlockState JSON:

Spoiler

{
   "variants": {
          "": [{ "model": "bettermusicmod:block/recorder" }]
   }
}

Block Model JSON:

Spoiler

{
   "parent": "block/orientable",
   "textures": {
       "top": "bettermusicmod:block/recorder",
       "front": "bettermusicmod:block/recorder_front",
       "side": "bettermusicmod:block/recorder"
   }
}

Item Model JSON:

Spoiler

{
   "parent": "bettermusicmod:block/recorder",
   "display": {
       "thirdperson": {
           "rotation": [ 10, -45, 170 ],
           "translation": [ 0, 1.5, -2.75 ],
           "scale": [ 0.375, 0.375, 0.375 ]
       }
   }
}

 

Edited by Zuve
Posted

Each variant needs to point to an object not an array of objects (remove the []). Your log should be telling you this

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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)

Posted
9 hours ago, Cadiboo said:

Each variant needs to point to an object not an array of objects (remove the []). Your log should be telling you this

Fixed this, but the issue still persists. There are no errors in the log, but the block remains invisible.

Posted
3 hours ago, V0idWa1k3r said:

Please show the code for your block. I have a very strong suspicion it extends BlockContainer.

Thanks, this pointed me in the right direction. I was missing methods for the direction and render type.

Posted (edited)
2 hours ago, Zuve said:

Thanks, this pointed me in the right direction. I was missing methods for the direction and render type.

You should not be overriding extending BlockContainer.

Edited by DavidM
typo

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted (edited)
38 minutes ago, DavidM said:

overriding

*extending

BlockContainer is legacy vanilla code. Forge provides a much better system

Edited by Cadiboo
  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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)

Posted
4 hours ago, Cadiboo said:

*extending

BlockContainer is legacy vanilla code. Forge provides a much better system

I wasn't aware of this. Do you have links to any documentation for the system? Searching for forge custom container doesn't seem to show me anything.

Posted

Just override hasTileEntity(IBlockState) and createTileEntity(IBlockState). That’s it

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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)

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



×
×
  • Create New...

Important Information

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