Anvil Recipies?

Started by NaiduBoys on Thu, 07/12/2018 - 08:35

Topic category: Help with modding (Java Edition)

Last seen on 04:38, 22. Oct 2020
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Anvil Recipies?
Thu, 07/12/2018 - 08:35

Does anyone know how to make anvil recipes or is it not possible?

For example if you put my custom sword (emerald sword) in an anvil could I make a special way to repair it?

If it is not possible I will suggest the feature to MCreators Devs

Last seen on 17:52, 21. Oct 2020
Joined Jul 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You have to make you own…
Fri, 07/20/2018 - 15:47

You have to make you own Anvil Item that haves a Gui Where it says Emerald Sword Special and you make it take a emerald sword (what else you need for it)Then it give you a new one.

   /\__/\
(=^ . ^=)
(“)_(“)_/

Last seen on 17:52, 21. Oct 2020
Joined Jul 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
My Discord is Taco_Storm3D
Sat, 07/21/2018 - 18:22

My Discord is Taco_Storm3D

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can try to override Item…
Sat, 07/21/2018 - 19:42

You can try to override Item#getIsRepairable() in your item class and check if the Item from the 2nd ItemStack is the one, that you want to use for repair. (The first ItemStack is the item that is being repaired)

Last seen on 04:38, 22. Oct 2020
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Ummm sorry but I’m not goos…
Sun, 07/22/2018 - 11:24

Ummm sorry but I’m not goos with classes 

Could you pleas explain this a bit more to me

Thanks

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Class Item has a method…
Sun, 07/22/2018 - 11:54

Class Item has a method called getIsRepairable(), this method takes two parameters - both of type ItemStack. The first one is the repaired item, the second one is the item used for repairing. All you have to do is just overriding it like you would do with any other Java method. This method returns a value of type boolean, that in other parts of Minecraft code determine if it can be repaired. What you want to do is return if the Item in the second ItemStack is equal to your desired Item:

@Override
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair)
{
	return repair.getItem() == INSTANCE_OF_ITEM; //replace INSTANCE_OF_ITEM by your desired Item
}

 

Last seen on 04:38, 22. Oct 2020
Joined Mar 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Ok thanks  Sorry for…
Tue, 07/24/2018 - 11:07

Ok thanks 

Sorry for spelling mistake (was meant to be good)

Last seen on 14:46, 11. Sep 2019
Joined Aug 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hey Nuparu, could you spell…
Mon, 08/27/2018 - 23:18

Hey Nuparu, could you spell it out a little more for newbies like me? This code you wrote would go in the tools' code, right?

And what format are we writing those arguments in? Because simply writing the name of the element, for example (getIsRepairable(ElvenAxe, ElvenRepairKit)  doesn't work