Jump to content

How to extend vanilla skull?


Wuodan

Recommended Posts

I would like to either create my own block and item based on BlockSkull and ItemSkull, so make use of the existing model and rendering, or, extend the vanilla classes? How can I do that?

 

I've tried creating the block and ItemBlock, but I hit problems like:

 

[17:22:28] [Client thread/ERROR] [FML]: Exception loading model for variant examplemod:myskull#facing=south,nodrop=false for blockstate "examplemod:myskull[facing=south,nodrop=false]"

net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model examplemod:myskull#facing=south,nodrop=false with loader VariantLoader.INSTANCE, skipping

 

The Minecraft and Forge source code is still too twisted for me to follow.

 

I've also tried:

 

GameRegistry.addSubstitutionAlias("minecraft:skull", GameRegistry.Type.BLOCK, mySkull);

 

but that didn't work. I even tried just aliasing sand but get this:

 

java.lang.RuntimeException: Duplicate stat id: "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Sand', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" and "TranslatableComponent{key='stat.useItem', args=[TextComponent{text='[', siblings=[TextComponent{text='Sand', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}, TextComponent{text=']', siblings=[], style=Style{hasParent=true, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], style=Style{hasParent=true, color=§f, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=HoverEvent{action=SHOW_ITEM, value='TextComponent{text='{id:"minecraft:sand",Count:1b,Damage:0s}', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}'}, insertion=null}}], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}" at id stat.useItem.minecraft.sand

at net.minecraft.stats.StatBase.registerStat(StatBase.java:111) ~[forgeSrc-1.9.4-12.17.0.1976.jar:?]

 

I've also tried using forge-1.10.2-12.18.1.2011-mdk

 

Is it possible to either extend BlockSkull (and ItemSkull, TileEntitySkull), or, replace the vanilla classes with my customized classes?

Link to comment
Share on other sites

Are you trying to create a NEW block that acts like a skull or are you trying to REPLACE the skull block class with a new one?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I would be happy either way. If I create a new block that acts like a skull, then I can conveniently take advantage of the rendering and it will just have the same look and feel of skull blocks, items, and tile entities. I can then customize the texture and behavior as needed.

 

If I extend the vanilla class, it would only be to add a new subtype for the same purpose -- I want a new skull item with its own texture and behavior. I could just tweak the vanilla class enough to allow for an extra skull type and change its behavior accordingly.

Link to comment
Share on other sites

Then don't use addSubstitutionAlias

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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



×
×
  • Create New...

Important Information

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