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

Hi.

 

I hope I'm not asking something obvious, but I haven't been able to find the answer anywhere.

 

Is it possible to get a block object and/or ID by the block's text name, for mod-generated blocks?  It seems to me that, from a programming point of view, this would be the best way of allowing mods to interact with each other, without worrying about internal IDs.

 

I'd like to write a mod that makes use of custom blocks that exist in another mod, but that mod uses undocumented ID/meta values.  (Specifically, I want to use some of the blocks from the Condensed Blocks mod in recipes.)

 

I've tried using the ID Resolver mod to find out more info about the blocks in question, but it just hangs my Minecraft during loading.

 

The mod does use a config file for the base IDs of the blocks, but the few blocks I'm looking for, specifically, don't have any mention in the config.

 

Anyone have any ideas?

 

Thanks.

 

  • Author

Hi.

 

I hope I'm not asking something obvious, but I haven't been able to find the answer anywhere.

 

Is it possible to get a block object and/or ID by the block's text name, for mod-generated blocks?  It seems to me that, from a programming point of view, this would be the best way of allowing mods to interact with each other, without worrying about internal IDs.

 

I'd like to write a mod that makes use of custom blocks that exist in another mod, but that mod uses undocumented ID/meta values.  (Specifically, I want to use some of the blocks from the Condensed Blocks mod in recipes.)

 

I've tried using the ID Resolver mod to find out more info about the blocks in question, but it just hangs my Minecraft during loading.

 

The mod does use a config file for the base IDs of the blocks, but the few blocks I'm looking for, specifically, don't have any mention in the config.

 

Anyone have any ideas?

 

Thanks.

 

  • Author

Or... maybe not.  Looks like that function was added in the last couple of revisions.  I need to wait for all my favorite mods to update to 1.5.1 first. :-(  I'm still on 1.4.7, and that function doesn't exist yet.  Oh, well.  Patience...

  • Author

Or... maybe not.  Looks like that function was added in the last couple of revisions.  I need to wait for all my favorite mods to update to 1.5.1 first. :-(  I'm still on 1.4.7, and that function doesn't exist yet.  Oh, well.  Patience...

foreach Block block inn BlockList

if (block.name == name)

return block

If you guys dont get it.. then well ya.. try harder...

foreach Block block inn BlockList

if (block.name == name)

return block

If you guys dont get it.. then well ya.. try harder...

it should be in the mod owners mcmod info file, or in the main mod class under modid = "MODID", alternatively if you do not have access to either of these you would have to ask thr mod creator.

Use examples, i have aspergers.

Examples make sense to me.

it should be in the mod owners mcmod info file, or in the main mod class under modid = "MODID", alternatively if you do not have access to either of these you would have to ask thr mod creator.

Use examples, i have aspergers.

Examples make sense to me.

foreach Block block inn BlockList

if (block.name == name)

return block

minecraft is coded in java not in c#

c#

foreach(Block b in Block.blocksList){

if(b.name.Equals(name))

return block;

}

java

for(Block b : Block.blocksList){

if(b.name.equals(name)

return block;

}

foreach Block block inn BlockList

if (block.name == name)

return block

minecraft is coded in java not in c#

c#

foreach(Block b in Block.blocksList){

if(b.name.Equals(name))

return block;

}

java

for(Block b : Block.blocksList){

if(b.name.equals(name)

return block;

}

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.