Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author

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?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.