September 4, 20196 yr 2 hours ago, MineModder2000 said: Well anyways this didn't work as iron golems still drop iron ingots : That's because the ResourceLocation given by getName has a folder in the path IE entities/iron_golem. Also the namespace is the file name not the item it drops. You'll have to look at the LootTable/LootPool(s). Edited September 5, 20196 yr by Animefan8888 VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 5, 20196 yr Author 52 minutes ago, Animefan8888 said: That's because the ResourceLocation given by getName has a folder in the namespace IE entities/iron_golem. Also the namespace is the file name not the item it drops. You'll have to look at the LootTable/LootPool(s). The below code isn't cancelling the loot. if (event.getName().getNamespace().equals("entities/iron_golem")) { event.setCanceled(true); }
September 5, 20196 yr 8 minutes ago, MineModder2000 said: .getNamespace() This returns the modid(both of our mistakes). You need to use getPath. Also just canceling the event will cause all of the drops for the iron_golem to not drop. So maybe try to remove the pool for the iron ingots instead. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 5, 20196 yr Author 1 hour ago, Animefan8888 said: This returns the modid(both of our mistakes). You need to use getPath. Also just canceling the event will cause all of the drops for the iron_golem to not drop. So maybe try to remove the pool for the iron ingots instead. I tried this, with and without the "item" before "leather", to no avail. @SubscribeEvent public void lootTableLoadEvent(LootTableLoadEvent event) { if (event.getName().getPath().equals("entities/horse")) { event.getTable().removePool("item/leather"); } }
September 5, 20196 yr 16 minutes ago, MineModder2000 said: event.getTable().removePool("item/leather"); There is only one pool in entity loot tables it's called "main" and you need to remove an entry in that pool. Not the pool itself. Edited September 5, 20196 yr by Animefan8888 VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 5, 20196 yr Author 7 minutes ago, Animefan8888 said: There is only one pool in entity loot tables it's called "main" and you need to remove an entry in that pool. Not the pool itself. Not seeing any methods beyond this that allow for specific entry removal..... event.getTable().getPool("main")
September 5, 20196 yr If you want to remove an item from a pool knowing only the item: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/util/LootUtils.java#L34 You need reflection. (Note: that removes it from all pools, you may wish to only remove from the main pool, from a pool by name, or...) Edited September 5, 20196 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 5, 20196 yr 5 minutes ago, MineModder2000 said: Not seeing any methods beyond this that allow for specific entry removal..... That's because they haven't been implemented in 1.14 forge , yet(I assume). They are currently commented out in the source code under the forge section. You'll have to use Reflection like Draco18s has so helpfully provided an example for. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 5, 20196 yr Author 9 minutes ago, Draco18s said: If you want to remove an item from a pool knowing only the item: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/util/LootUtils.java#L34 You need reflection. (Note: that removes it from all pools, you may wish to only remove from the main pool, from a pool by name, or...) 7 minutes ago, Animefan8888 said: That's because they haven't been implemented in 1.14 forge , yet(I assume). They are currently commented out in the source code under the forge section. You'll have to use Reflection like Draco18s has so helpfully provided an example for. Thanks guys, I will consider if this is what I want to do, else I will do the json overriding technique instead.
September 9, 20196 yr Probably. Have you tried looking at the code that handles it? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 10, 20196 yr Author 11 hours ago, Draco18s said: Probably. Have you tried looking at the code that handles it? Please show me where that is.
September 10, 20196 yr Literally knowing fuckall about where to look, let me see... oh hey, there's a net.minecraft.entity.merchant package. I wonder what's in here. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 10, 20196 yr Author 2 hours ago, Draco18s said: Literally knowing fuckall about where to look, let me see... oh hey, there's a net.minecraft.entity.merchant package. I wonder what's in here. My dreams of becoming a ballerina? I see the public field that I can change in VillagerTrades, I'll take a crack at it. Edited September 10, 20196 yr by MineModder2000
September 10, 20196 yr 9 hours ago, MineModder2000 said: My dreams of becoming a ballerina? ? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
September 10, 20196 yr Author I'm stoked that I got this to work, my test of farmers offering diamond axes was successful. I just realized that whatever trades the villagers load with, that's it, you can't change it retroactively, important note for testing. Edited September 12, 20196 yr by MineModder2000
September 12, 20196 yr Author Is it possible to disable right click on interaction blocks such as furnace, smoker, etc.? Edited September 12, 20196 yr by MineModder2000
September 13, 20196 yr 23 hours ago, MineModder2000 said: Is it possible to disable right click on interaction blocks such as furnace, smoker, etc.? Of course it is. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 13, 20196 yr 58 minutes ago, MineModder2000 said: HOW Several ways. Why not take a look at the net.minecraftforge.event package and sub-packages? There is definitely an event for what you want. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 13, 20196 yr Author 10 minutes ago, Animefan8888 said: Several ways. Why not take a look at the net.minecraftforge.event package and sub-packages? There is definitely an event for what you want. Ah, I did this before asking but I missed it. It has the literal name : RightClickBlock, doh! Edited September 13, 20196 yr by MineModder2000
September 13, 20196 yr Author Hmm, i tried both of the following, no cigar : @SubscribeEvent public void rightClickBlock(RightClickBlock event) { event.setCanceled(true); } @SubscribeEvent public void entityInteract(EntityInteract event) { event.setCanceled(true); } PlayerInteractEvent is where these are located.
September 13, 20196 yr 13 hours ago, MineModder2000 said: Hmm, i tried both of the following, no cigar : Read the javadoc above the class. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
September 13, 20196 yr Author 9 hours ago, diesieben07 said: Are you using the latest version of Forge for 1.14.4? I recall the interaction events were not fully working in the earlier versions. Also, did you try using the debugger to see if your event handlers are called at all? I am using 28.0.27. I can't run from Eclipse, I get errors. Updating may solve the problem. 3 hours ago, Animefan8888 said: Read the javadoc above the class. I did, it just goes over how it fires and what not. /** * This event is fired on both sides whenever the player right clicks while targeting a block. * This event controls which of {@link net.minecraft.block.Block#onBlockActivated} and/or {@link net.minecraft.item.Item#onItemUse} * will be called after {@link net.minecraft.item.Item#onItemUseFirst} is called. * Canceling the event will cause none of the above three to be called * * Let result be a return value of the above three methods, or {@link #cancellationResult} if the event is cancelled. * If we are on the client and result is not {@link EnumActionResult#SUCCESS}, the client will then try {@link RightClickItem}. * * There are various results to this event, see the getters below. * Note that handling things differently on the client vs server may cause desynchronizations! */ Canceling the event will cause none of the above three to be called, so it should work.
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.