Jump to content

[1.7.10] ItemBlock to place vanilla block


Palinator2

Recommended Posts

I made all types of spawners available as Items (placing the spawner with the rigth mob works YEAH!) in the creative tabs but the texture is still an ugly item texture so how can I make the Item an ItemBlock to render the item in the players inventory as vanilla spawner block?

 

To make it more clear:

 

For now all the different types of spawners are renderes as Item and also implemented as Item which are placing a vanilla Blocks.mob_spawner in the world and configuring it's held Entity and NBT data to spawn the wanted type of mob < working! But I want them to be rendered as Block in the players inventory and in the player's hand so I thougth I can simply change Item to ItemBlock and re-use the vanilla Spawner block so the ItemBlock looks exactly the same as the vanilla spawner.

 

I have:

public class MonsterSpawner extends ItemBlock {

    public MonsterSpawner() {
        super(Blocks.mob_spawner);
        setCreativeTab(CreativeTabs.tabMisc);
    }
}

 

which gives me:

java.lang.IllegalStateException: Can't free registry slot 52 occupied by net.minecraft.item.ItemBlock@183e8023

Link to comment
Share on other sites

You will not be able to use ItemBlock, an ItemBlock must always be bound to a block and every block can have at most one ItemBlock.

 

Best solution: Update to 1.8 and use this to set the NBT data directly on the normal spawner item. Then you can use the model system to provide an alternative model for those items.

 

Okay thank you very much, it's now clear to me how ItemBlock works. But I need this for 1.7.10 so is there really no other way?

 

Can I make a custom Block wich has the exact save behavior as the MobSpawner block? Can I just use something like CustomSpawner extends MobSpawner or so to make an exact copy as new block? In this case which Block have I use to?

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.