Jump to content

[1.12.2] Water Crafting with dropped items like AE2


CrashDbo

Recommended Posts

I am working on a mod that is based off finding crystals and analyzing them to get different attributes. Some will grant an effect on use some will be used in a form of crafting like the AE2 water crafting. I am having trouble finding the code in AE2 that allows the player to toss items in water and have it spawn a new item stack.

 

My main questions I have now are:

What should I be looking for to detect my crystal is in water?

Secondary is when you drop and item on the ground does is then spawn as an entity item?

 

I'm sure I will have many more questions as this develops, but for now thanks to those reading.

Edited by CrashDbo
Link to comment
Share on other sites

52 minutes ago, CrashDbo said:

What should I be looking for to detect my crystal is in water?

You can subscribe to ItemTossEvent and keep track of relevant items, then check to see if your conditions are met within one of the TickEvents. Keep in mind that there's no guarantee that the items remain in the world once thrown, so your list of items should update to remove those that should no longer exist.

55 minutes ago, CrashDbo said:

Secondary is when you drop and item on the ground does is then spawn as an entity item?

Yes. Within the inventory, items are ItemStack objects, while on the ground they're EntityItem objects. You can get the ItemStack represented by an EntityItem through EntityItem#getItem().

  • Thanks 1

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Link to comment
Share on other sites

3 hours ago, SerpentDagger said:

You can subscribe to ItemTossEvent and keep track of relevant items, then check to see if your conditions are met within one of the TickEvents

I would recommend creating a custom ItemEntity for your custom item, and return an instance of your ItemEntity in Item#createEntity (as well as override Item#hasCustomEntity to return true).

With this approach you can simply check for water in your EntityItem’s update method.

  • Thanks 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

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

    • Crypto Recovery Expert with Trustwizardhackworld Trustwizards Hackworld is Russia American Millennial Finance and Crypto Recovery Expert® and America’s Student School upgrade and Mobile spy™, and the founder of The Trustwizards Hackworld Crypto Recovery, a personal finance and recovery web-site dedicated to helping individuals and businesses escape from online investment and crypto perils and to start legitimate investing and building wealth for the future. You can learn more about him on the About Page, or on his personal web-site Trustwizardhackworld {.} com . He has been quoted in major publications including the New York Times, Washington Post, Fox, ABC, NBC, and more. He is also a regular contributor to Forbes. and Google search for Trustwizards Hackworld online for comments and reviews. I wholeheartedly recommend to anyone in need of digital asset recovery services. Their demonstrated ability to overcome seemingly impossible challenges, coupled with their unwavering commitment to their clients, makes them a trusted and reliable partner in the realm of digital asset recovery.
    • I tried this version, but it solved a part of my problem, there are still mods with this bug.    
    • I finally got to the server but when i got loaded in the game crashed https://pastebin.com/ADqmtkfR
    • Hi! I'm following Kaupenjoe's guide and making an entity, and I get a problem where two animations mix into one when my entity walks - idle  anim plays together with walking. As I'm pretty new into coding and modding, I don't know everything about what I do following his guide and I'd like to set up animations in specific way: 1. When entity is doing nothing, idle animation plays; 2. When entity is walking, only walk animation is playing Here's the code for this entity's animations, it only has 2 at the moment. What should I fix here to get the result I need? public final AnimationState idleAnimationState = new AnimationState(); private int idleAnimationTimeout = 0; @Override public void tick() { super.tick(); if(this.level().isClientSide()){ setupAnimationStates(); } } private void setupAnimationStates() { if(this.idleAnimationTimeout <= 0) { this.idleAnimationTimeout = this.random.nextInt(40) + 80; this.idleAnimationState.start(this.tickCount); } else { --this.idleAnimationTimeout; } } @Override protected void updateWalkAnimation(float pPartialTick) { float f; if(this.getPose() == Pose.STANDING) { f = Math.min(pPartialTick * 6F, 1f); } else { f = 0f; } this.walkAnimation.update(f, 0.2f); } Hopefully I got into right forum topic, I'm not very used to forum posting xDD  
    • DAFTAR WSOSLOT88 KLIK DISINI ATAU KETIK GOOGLE >> WSOSLOT88.COM       Slot Freebet Terbaru tanpa deposit dan tanpa syarat telah mengubah paradigma perjudian daring dengan memberikan kesempatan yang luar biasa bagi para pemain untuk menikmati permainan Slot tanpa tekanan finansial atau kendala persyaratan. Ini adalah langkah revolusioner dalam industri perjudian online yang mengutamakan pengalaman pemain. Dengan menawarkan kesempatan untuk mencoba berbagai permainan dan peluang menang tanpa modal, Slot freebet ini menjadi pilihan yang sangat menarik bagi para pecinta Slot di seluruh dunia. Jadi, jangan lewatkan kesempatan emas ini untuk merasakan sensasi keseruan permainan Slot tanpa harus membayar sepeser pun! Keyword terkait : Slot Freebet Slot Freebet Tanpa Deposit Slot Freebet Tanpa Syarat Slot Freebet Terbaru Slot Freebet Gratis Slot Freebet Tanpa Deposit 2024 Slot Freebet Tanpa Deposit Tanpa Syarat 2024 Slot Freebet 15k Tanpa Deposit Tanpa Syarat 2024 Slot Freebet 25k Tanpa Deposit Tanpa Syarat 2024 Slot Freebet 50k Tanpa Deposit Tanpa Syarat
  • Topics

×
×
  • Create New...

Important Information

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