Jump to content

Recommended Posts

Posted

I have been looking for an answer for a little while

How do I check when an item is thrown into a fire then change what the item is?
Example, change potato to cooked potato

Posted

It should be noted that items do burn in fire (You would have to override that). I am slightly confused on what your plan is. Do you want the cooked item to be thrown out from the fire and onto the player once it is finished? You could always make a block similar to the normal Fireplace in Minecraft (which also cooks food). Maybe take a look at that class.

Posted
7 hours ago, PulseBeat_02 said:

It should be noted that items do burn in fire (You would have to override that). I am slightly confused on what your plan is. Do you want the cooked item to be thrown out from the fire and onto the player once it is finished? You could always make a block similar to the normal Fireplace in Minecraft (which also cooks food). Maybe take a look at that class.

I will make it so it doesn't burn, i just want to know how to check if an item is in the fire and its, for example, a potato and change it to another item, cooked potato

Posted

Let them burn in fire...you can use the EntityLeaveWorldEvent, which will be fired also when an ItemEntity collide with a fire block (which causes the entity to disappear)...inside the event handler first check if the Entity is an instaceof ItemEntity. If thats the case check if the ItemEntity represent the item you want to cook (for example your potato). Then check if the position of the ItemEntity coincide with the position of a fire block ----> spawn a new ItemEntity in the world (in your case cooked potato) ...possibly 1 or 2 block away from the fire block or you won't see your item for long time! If instead you want that behaviour for a custom item you made just override onEntityItemUpdate inside your item class. That's just an idea, as there are other ways to do what you want to accomplish

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
19 minutes ago, diesieben07 said:

EntityLeaveWorldEvent is not very reliable... I would suggest using EntityJoinWorldEvent and replacing the item entities for which you want special behavior. Then just program the behavior you want in that custom entity.

Just for curiosity sake, why is EntityLeaveWorldEvent less reliable?

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
3 hours ago, Beethoven92 said:

That makes sense..but i suppose since the player has to be near the fire to throw the item in, is there really a possibility for the entity to be removed in any other way than by fire collision?

Yes, but other items elsewhere in the world might also leave for other reasons at any time.

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.

Posted
2 hours ago, Draco18s said:

Yes, but other items elsewhere in the world might also leave for other reasons at any time.

You are absolutely right, but still inside the event i would check if the last position of the ItemEntity of the type i want (eg. potato) was inside a fire block...so i don't really see how this could eventually fail..the condition for the cooked item to spawn is pretty strict, unless i am missing something very obvious..

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Posted
5 minutes ago, Beethoven92 said:

You are absolutely right, but still inside the event i would check if the last position of the ItemEntity of the type i want (eg. potato) was inside a fire block...so i don't really see how this could eventually fail..the condition for the cooked item to spawn is pretty strict, unless i am missing something very obvious..

Because checking what block is at a position for a chunk that is being unloaded causes the chunk to be loaded again.

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.

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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