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.

ratepenade

Members
  • Joined

  • Last visited

  1. Hey, I tried to display a random item description among a pre-defined message list. It doesn't works so much well because instead of displaying one message, the description is blinking, displaying all the predefined messages at each second. Here is my code : @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { String[] randMessages = new String[]{"Alpha", "Bravo", "Charlie"}; String randMessage = randMessages[player.getRNG().nextInt(randMessages.length)]; list.add(EnumChatFormatting.RED + randMessage); } Does anyone know the solution? Thank you so much, Best regards
  2. Hey, I would like to display a random item description among a predefined words list. I tried that : import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; public class ItemTest1 extends Item { public ItemTest1() { this.maxStackSize = 1; } public void addInformation(ItemStack stack, World world, EntityPlayer player, List list, boolean par4) { if(!world.isRemote) { String[] randMessages = new String[]{"Alpha", "Bravo", "Charlie"}; String randMessage = randMessages[world.rand.nextInt(randMessages.length)]; list.add(EnumChatFormatting.RED + randMessage); } } } But it doesn't seem to works.. Any idea ? Thank you very much for your help

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.