Stop the player from using a certain item when reaching a certain durability

Started by JPZamps on Fri, 05/06/2022 - 23:07

Topic category: Help with modding (Java Edition)

Last seen on 19:59, 24. Jun 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Stop the player from using a certain item when reaching a certain durability
Fri, 05/06/2022 - 23:07

I would like the player to only be able to use a certain item if it has the durability above 1, the initial idea was to make the item not break when it reached 0, but it seemed more complicated and just not being able to use it when it reached 0 1 will be enougha
So far this is all I've been able to use, I thought it would be able to, but for some reason the item (which has 32 durability) stops working when it reaches 31 durability not 1

I tried a lot but for now I can't think of anything else, any suggestions or ideas?

Last seen on 19:18, 4. Jun 2022
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
can you go into minecraft…
Sat, 05/07/2022 - 02:43

can you go into minecraft and do the action twice then just have the log from that time also can you place at the front of the procedure a logged message with info as a parameter then write "Ak74 do action start" then add another one in the if statement that says "Fired Ak74" then add an else statement with a log and say "Didn't fire the Ak74" then write after the if else statement make a log that says "Ak74 do action end" then just select between the start and the end in the log and place it in here

Last seen on 19:59, 24. Jun 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I'm sorry but I didn't quite…
Sat, 05/07/2022 - 02:50

I'm sorry but I didn't quite understand what you meant, could you attach an image or something? I'm sorry again

Last seen on 16:02, 17. Jun 2022
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
In my example a trigger is…
Sat, 05/07/2022 - 21:28

In my example a trigger is used "When block is broken" which you do not need to use, if your procedure is on the "Update Tick" or "When Item is used" of your item.

The Cancel event can be found under the advanced tab in your procedure. What it will do is if your IF condition is false then it will cancel the event that triggers your item. For example if it is a bow and you go to fire it with 1 durability then it will simply cancel the shooting action.

Screenshot ↓

https://i.imgur.com/WsaFLoE.png

Last seen on 19:59, 24. Jun 2022
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
hey, I tried your procedure…
Mon, 05/09/2022 - 18:13

hey, I tried your procedure but for me to cancel a global event there has to be one happening, unfortunately there is no way to use this procedure, only it being in '' whem item is used'' or ''item update tick'' appears a message that says a global event must be selected, but I'll still be trying if anyone has another idea