Jump to content

Moomallowz

Members
  • Posts

    22
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Moomallowz's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Never mind, I've figured it out on my own.
  2. 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?
  3. 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?
  4. Happy New Year to anyone who stumbles across this topic, by the way.
  5. 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?
  6. 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.
  7. IT WORKS! Thank you, good sir!
  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!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.