Jump to content

[1.14.4] Modifying Vanilla Content


MineModder2000

Recommended Posts

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 by Animefan8888
  • Thanks 1

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.

Link to comment
Share on other sites

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);
    	}

 

Link to comment
Share on other sites

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.

  • Thanks 1

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.

Link to comment
Share on other sites

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");
    	}
    }
    
Link to comment
Share on other sites

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 by Animefan8888
  • Thanks 1

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.

Link to comment
Share on other sites

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 by Draco18s
  • Thanks 1

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.

Link to comment
Share on other sites

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.

  • Thanks 1

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by MineModder2000
Link to comment
Share on other sites

9 hours ago, MineModder2000 said:

My dreams of becoming a ballerina?

?

  • Haha 1

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.

Link to comment
Share on other sites

23 hours ago, MineModder2000 said:

Is it possible to disable right click on interaction blocks such as furnace, smoker, etc.?

Of course it is.

  • Thanks 1

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.

Link to comment
Share on other sites

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.

  • Thanks 1

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.

Link to comment
Share on other sites

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 by MineModder2000
Link to comment
Share on other sites

13 hours ago, MineModder2000 said:

Hmm, i tried both of the following, no cigar :

Read the javadoc above the class.

  • Thanks 1

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • This is a MacOs related issue: https://bugs.mojang.com/browse/MC-118506     Download this lib: https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar and put it into ~/Library/Application Support/minecraft/libraries/ca/weblite/java-objc-bridge/1.0.0  
    • I use Bisect-Hosting, and I host a relatively modded server.  There is a mod I desperately want to have in a server. https://www.curseforge.com/minecraft/mc-mods/minehoplite This is MineHop. It's a mod that replicates the movement capabilities seen in Source Engine games, such as Half-Life, and such.  https://youtu.be/SbtLo7VbOvk - A video explaining the mod, if anyone is interested.  It is a clientside mod, meaning whoever is using it can change anything about the mod that they want, with no restrictions, even when they join a server with the same mod. They can change it to where they can go infinitely fast, or do some other overpowered thing. I don't want that to happen. So I just want to know if there is some way to force the SERVER'S configuration file, onto whoever is joining.  I'm not very savvy with all this modding stuff. There are two config files: minehop-common.txt, and minehop.txt I don't really know much about how each are different. I just know what the commands relating to acceleration and stuff mean.    
    • My journey into crypto trading began tentatively, with me dipping my toes into the waters by purchasing my first Bitcoin through a seasoned trader. With an initial investment of $5,000, I watched as my investment grew, proving to be both fruitful and lucrative. Encouraged by this success, I decided to increase my investment to $150,000, eager to capitalize on the growing popularity of cryptocurrency, However, as cryptocurrency gained mainstream attention, so too did the number of self-proclaimed "experts" in the field. Suddenly, everyone seemed to be a crypto guru, and more and more people were eager to jump on the bandwagon without fully understanding the intricacies of this complex world. With promises of quick and easy profits, these con artists preyed on the uninformed, luring them into schemes that often ended in disappointment and financial loss. Unfortunately, I fell victim to one such scheme. Seduced by the allure of easy money, I entrusted my hard-earned funds to a dubious trading platform, granting them access to my accounts in the hopes of seeing my investment grow. For a brief period, everything seemed to be going according to plan, with regular withdrawals and promising returns on my investment. However, my hopes were soon dashed when, without warning, communication from the platform ceased, and my Bitcoin holdings vanished into thin air. Feeling helpless and betrayed, I confided in a family member about my predicament. They listened sympathetically and offered a glimmer of hope in the form of a recommendation for Wizard Web Recovery. Intrigued by the possibility of reclaiming what I had lost, I decided to explore this option further. From the moment I reached out to Wizard Web Recovery, I was met with professionalism and empathy. They took the time to understand my situation and reassured me that I was not alone in my plight. With their guidance, I embarked on a journey to reclaim what was rightfully mine. Wizard Web Recovery's expertise and dedication were evident from the start. They meticulously analyzed the details of my case, uncovering crucial evidence that would prove invaluable in our quest for justice. With each step forward, they kept me informed and empowered, instilling in me a newfound sense of hope and determination. Through their tireless efforts and unwavering support, Wizard Web Recovery succeeded in recovering my lost Bitcoin holdings. It was a moment of triumph and relief, knowing that justice had been served and that I could finally put this chapter behind me. In conclusion, My experience with Wizard Web Recovery  was nothing short of transformative. Their professionalism, expertise, and unwavering commitment to their clients set them apart as true leaders in the field of cryptocurrency recovery. I am forever grateful for their assistance and would highly recommend their services to anyone in need of help navigating the treacherous waters of cryptocurrency scams. 
    • Ok so: Two things to note: It got stuck due to my dimension type. It was previously the same as the overworld dimension tpye but after changing it , it didn't freeze during spawn generation. ALSO, APPARENTLY, the way I'm doing things, the game can't have two extremely-rich dimensions or it will make the new chunk generation be veeery VEEERY slow. I'm doing the dimension file genreation all in the data generation step now, so it's all good. Mostly. If anybody has any tips regarding how can i more efficently generate a biome-rich dimension, im all ears.
    • https://mclo.gs/qTo3bUE  
  • Topics

×
×
  • Create New...

Important Information

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