-
Posts
22 -
Joined
-
Last visited
Everything posted by Moomallowz
-
[1.16.5] Within an event, summon a random item.
Moomallowz replied to Moomallowz's topic in Modder Support
Never mind, I've figured it out on my own. -
[1.16.5] Within an event, summon a random item.
Moomallowz replied to Moomallowz's topic in Modder Support
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? -
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?
-
[1.16.4] Remove 1 item in offhand ItemStack when an event fires.
Moomallowz replied to Moomallowz's topic in Modder Support
Happy New Year to anyone who stumbles across this topic, by the way. -
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?
-
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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. -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
IT WORKS! Thank you, good sir! -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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."); } } -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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. -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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. -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
Thanks! Now the Wandering Trader has a use, and my mod is ready to update! -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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? -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
That's what I was looking for, thank you sir. -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
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? -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
I am a dunce. I think I have it figured out now, though... thanks for the help! -
How do I add custom trades to the Wandering Trader?
Moomallowz replied to Moomallowz's topic in Modder Support
Thank you, good sir. Can I call this event in any class, or do I need to do it a specific way? -
I'm trying to add a new item to the Wandering Trader's list of trades. Do I make a class? Do I call an event? Do I modify a loot table? How would I, as an absolute dunce, achieve this?
-
mappings channel: 'snapshot', version: '20200707-1.16.1' minecraft 'net.minecraftforge:forge:1.16.1-32.0.63' These are the mappings and version I'm currently using. I tried to update myself, but couldn't find any good tutorials/tips and ended up with nearly 200 errors. What should I use, and where can I look for information in the future?
-
I've probably done something really idiotic here, but I need help regardless. I tried to install Forge 1.14.4 from this site. I clicked the Skip Ad button and a file called forge-1.14.4-28.1.107-installer.jar was downloaded. Fairly sure it was the correct file. Then, I pressed 'Open.' A few options for opening the file showed up, and I chose Internet Explorer (probably a bad idea, but it was a better choice than MS Paint.) Then, the 'what do you want to do with this file' window popped up. I clicked 'open' again. The 'View Downloads' window came up, with ANOTHER open button. Basically, the button looped me back to the first window. I'm assuming something's either wrong with Internet Explorer or my abysmally slow HP laptop. If you know what's wrong, please let me know!