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

So, in general, it's best to limit the metadata of your block to 16 values. However, what do I do when my block has, for example, 21 values that need to be stored?

 

I have a custom cake block- the cake has seven different values depending on how 'eaten' it is.

 

The cake also has a 'quality' - Poor, Decent, or Superb.

 

How can I store these values in the block metadata without going over 16?

Have a modding question? PM me and hopefully I'll be able to help. Good at 2d Pixel Art? We need your help!  http://www.minecraftforum.net/topic/1806355-looking-for-2d-pixel-artist/

You could store the eaten integer in metadata in an abstract cake block class. Then make three different blocks (Poor, Decent, or Superb) extending that class. This would eat (pardon the expression) block ID bits instead of metadata bits.

 

The concept here is that the quality doesn't change over time (does it?) but the eaten does. So you can place the block once as some quality of manufacture and then update its metadata as it is eaten. It's only a matter of convenience; there are objects in the game that swap blocks when conditions change (or at least they did in past versions of MC).

 

The downside is that each new block needs its own registrations, ItemBlock and JSON, but you've learned to love writing JSON files right?

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

The downside is that each new block needs its own registrations, ItemBlock and JSON, but you've learned to love writing JSON files right?

 

You can get around the second problem with an IStateMapper.

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.