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

My goal is to have something like a tablet computer in minecraft. Similar as the map (http://minecraft.gamepedia.com/Map) it should change its texture dynamically. The screen should show information like found in the debug screen [F3]. (Yes, it would be superfluous, but much more pretty in my opinion.)

 

By way of illustration:

https://dl.dropboxusercontent.com/u/43694603/tablet.png

 

How can i bring ever-changing content (text...) on an item's texture?

  • Author

Thank you. But trawling through unexplained foreign code can get very tedious..

 

Does somebody maybe know any related tutorial?

I doubt you will find a step-by-step tutorial

 

What you need is in MapItemRenderer:

DynamicTexture created, returns an int [] which is then overwritten directly by the RGB data.  Bind Dynamic texture when rendering.

 

 

-TGG

 

 

  • Author

Ok thank you very much! You seem to know how that works, but that was a really short explaination :D.

 

The only way adding item textures that i know is

    new Item().setTextureName("ID:Name").

 

How is MapItemRenderer to be used, when i have an Item object and nothing else?

 

Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill..

 

Is there maybe a more specific method?

Ok thank you very much! You seem to know how that works,

:-P well to be honest actually I'm just figuring this out as I go, plus a bit of background knowledge

 

but that was a really short explaination :D.

I wouldn't want to rob you of the satisfaction of a thrilling voyage of discovery :)

 

For me, a lot of the fun of programming minecraft is trying to pick my way through this incomprehensible swamp of vanilla code until it finally goes 'click' in my head and I understand how it works.  I think it's a very important skill for anyone who's going to try something more complicated than a new Block and a couple of recipes...

 

Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill..

 

Is there maybe a more specific method?

If you just need text, that's relatively simple; you could try looking into the FontRenderer.  It's scattered all throughout the vanilla code, for example the debug screen in Minecraft.displayDebugInfo; or the number of items in an itemstack in RenderItem.renderItemOverlayIntoGUI()

 

-TGG

 

 

 

  • Author

Now i'm stuck because i can not find a Forge Event that is fired when the player selects an item in the hotbar :(. Going through net.minecraftforge.event.* it seems like such an event doesn't exist.

 

Can somebody help, maybe describing a workaround for my intention?

Use ClientTick Event and check if the player holds your item. Then call the method you want.

 

I think it is

Minecraft.getMinecraft().thePlayer.getItemInUse();

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.