replace an item but keep the old durabity on the new item

Started by joab_ruben on Wed, 12/02/2020 - 03:15

Topic category: Help with modding (Java Edition)

Last seen on 23:15, 15. Dec 2020
Joined Dec 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
replace an item but keep the old durabity on the new item
Wed, 12/02/2020 - 03:15

so my problem is the following, i wanted to create a crossbow like the vanilla one, so i created an item with a procedure that when you right-click it replaces itself with a version with a new texture to make the illusion of animation then o the final one if you right-click again it will shoot an arrow via the procedure and replace itself again with a unload version and it works great and looks just like a vanilla crossbow,(i made a 3d to make it center on the screen like the vanilla one) but I also wanted to make that every time you fire an arrow it deal one damage to the item and so consumes 1 durability and it would work but as I'm replacing a crossbow for another item to create animation effect the health of the old item is also replaced so I can't make it to both have animation and changing/store loaded effect and keep the item durability every time it replaces itself, so how could I make a health value that is keeping throughout all the replacing and firing process?

Last seen on 19:15, 17. Mar 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think theres a get…
Wed, 02/17/2021 - 19:13

I think theres a get durability block so if you made a varible put the durability into a varible, then put the varible on a deal x damage to item that would work

Last seen on 08:00, 29. Jul 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
This is possible within the…
Sat, 04/03/2021 - 16:09

This is possible within the same procedure, but is it possible across multiple procedures? For example:

Assume a ranged item like a spear

How does one make it so that, assuming that and item spawns where it landed once the spear hits a mob / player / block, the item that spawns after hitting something, it has the same durability of the item you threw, minus 1? I am pretty sure this would require at least 2 procedures and some way to store the durability in a variable.

Like the trident currently does, it has full durability, you throw it, pick it up, boom, it has 1 less.

Is that possible inside of mcreator?

Last seen on 08:00, 29. Jul 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
This is possible within the…
Sat, 04/03/2021 - 16:11

This is possible within the same procedure, but is it possible across multiple procedures? For example:

Assume a ranged item like a spear

How does one make it so that, assuming that an item spawns where it landed once the spear hits a mob / player / block, the item that spawns after hitting something, it has the same durability of the item you threw, minus 1? I am pretty sure this would require at least 2 procedures and some way to store the durability in a variable.

Like the trident currently does, it has full durability, you throw it, pick it up, boom, it has 1 less.

Is that possible inside of mcreator?