Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14.4] Replacing Flint And Steel


CrimsonDawn45
 Share

Recommended Posts

In 1.14.4 the code that decides if a nether portal should open or not is contained within the flint and steel class.

 

I am wondering if there is a way to deregister the flint and steel item then reregister it still under minecraft using my class

I have tried making an anonymous subclass but the method I need to change is a protected static. So it wont just let me

override that method.

 

I want to do this because I am trying to change how nether portal's work and I need full control of this method.

Link to comment
Share on other sites

I should have been more clear basically what I want to do is if you look inside the flint and steel class where it says "== Blocks.OBSIDIAN" I want to change that to if it is in a tag called nether_portal_blocks that I will create I want to add a bunch of blocks that can also be used to create a nether portal

Edited by CrimsonDawn45
Link to comment
Share on other sites

Yea so what I think you can do is create an item, like "MyModdedFlintAndSteel" in your mod, then basically verbatim copy the flint and steel class from Minecraft, adjust i as you wish.

 

Then create a public static boolean method called "isNetherPortalBlock" with a Block or BlockState as a parameter. then just create like an array/list/arraylist with all of your blocks, Just iterate though the array/list and return true if the block matches.

 

Finally just replace the crafting recipe of flint and steel to return your modded flint and steel.

 

Is that kind of what you are looking for? Sorry if it isn't, I might have a disconnect on something.

C#, Java, and Lua are my forte's.

Currently Working On: Minecraft Manipulation

Let's play test!

Link to comment
Share on other sites

2 hours ago, CrimsonDawn45 said:

but the method I need to change is a protected static. So it wont just let me

override that method.

Yes. You would need to change it another way. Intercepting the item use events is probably able to achieve what you want.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

Guest
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.

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.