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.

Moomallowz

Members
  • Joined

  • Last visited

  1. Moomallowz changed their profile photo
  2. Never mind, I've figured it out on my own.
  3. You mention the 'world' variable, but it doesn't seem to exist. Must I create it in the event as well, and if so, how?
  4. I have an event which fires when a "clam" item is used. I would like to summon an item at the player's location, within the if/else statement shown below. @SubscribeEvent public static void clamUsed(PlayerInteractEvent.RightClickItem event) { LivingEntity player = event.getEntityLiving(); ItemStack mainhand = player.getItemStackFromSlot(EquipmentSlotType.MAINHAND); if (player.getHeldItemMainhand().getItem() == RegistryHandler.CLAM.get()) { Random random = new Random(); if (random.nextInt(20 - 1 + 1) + 1 == 20) { //Give the player Item A } else { //Give the player Item B } mainhand.shrink(1); } } How?
  5. Happy New Year to anyone who stumbles across this topic, by the way.
  6. Here's my event, which fires when a fishing rod is cast (or reeled in, I'll fix that later). @SubscribeEvent public static void usedWorm(PlayerInteractEvent.RightClickItem event) { LivingEntity player = event.getEntityLiving(); if (player.getHeldItemOffhand().getItem() == RegistryHandler.WORM.get()) { if (player.getHeldItemMainhand().getItem() == Items.FISHING_ROD) { player.addPotionEffect(new EffectInstance(Effects.LUCK, 2400)); //fairly certain the ItemStack thingy goes here, not sure about syntax though } } } The event is currently allowing the offhand item (the Worm) to be used an infinite number of times. To maintain balance, a Worm must be consumed when this is done. It is absolutely imperative to catching funny fish. I am unfamiliar with ItemStacks and their applications. Is it possible to dumb this down enough for my ogre brain to comprehend?
  7. In my defense, I now know how to add ".get()" to the end of my line, thus giving it an instance of a modded item to work with.
  8. public class Main { public static void main(String[] args) { System.out.println("Sir, I'd greatly appreciate it if you at least told me what I did wrong."); } }
  9. If you were asking for my issue... REQUIRED TYPE: IItemProvider PROVIDED: RegistryObject <net.minecraft.item.item> If you were asking what my issue was, everything I touch breaks. It's hereditary, I think.
  10. I'M SO SORRY, BUT AW BEANS, I MESSED IT UP. event.getGenericTrades().add(new BasicTrade(3, new ItemStack(RegistryHandler.EXOTIC_SPICE, 1), 10, 10)); This is what I have. I probably did something stupid, but I don't know what.
  11. Thanks! Now the Wandering Trader has a use, and my mod is ready to update!
  12. By the way, and I hate to be a bother, what would I need to do to add a modded item to the trade rather than a vanilla one?
  13. That's what I was looking for, thank you sir.
  14. Never mind. Apparently, my stupidity knows no bounds, because about 83 errors were returned. I'm fairly certain that adding trades has to do with the BasicTrade class. however, and I've tried adding it into the method where I call the WandererTradesEvent. No luck so far, though. Stupid as I may be, with the little experience in Java that I have, I will keep trying. Can someone walk me through setting up a trade?
  15. I am a dunce. I think I have it figured out now, though... thanks for the 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.