Damage items in item inventory

Started by Shminecrafter on

Topic category: Help with modding (Java Edition)

Last seen on 14:30, 14. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Damage items in item inventory

I have an item with an inventory and I have it so when I swing the item it does something. I also want it to take damage. I can't figure out a way to make the item inside take damage.

Procedure

Last seen on 14:53, 4. Jul 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well I think theres a block…
Wed, 07/13/2022 - 15:26

Well I think theres a block that says deal one damage to provided itemsack.

Last seen on 14:30, 14. Jul 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is, but I can't find a…
Wed, 07/13/2022 - 15:31

There is, but I can't find a way to select the item in the inventory (only a copy)

 

Last seen on 14:53, 4. Jul 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well why do you have a copy…
Thu, 07/14/2022 - 14:52

Well why do you have a copy you could just do has item in inventory of source entity

Last seen on 21:59, 18. Apr 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think targeting an item in…
Fri, 10/28/2022 - 14:01

I think targeting an item in a specific slot of any inventory is only possible via the blocks containing "get copy of..."
At least I think this is what' the issue.

Last seen on 15:16, 19. Apr 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try like this and put the…
Mon, 10/31/2022 - 13:30

try like this and put the cooldown and 2nd "if do" in both after or before deal 1 damage: 

hope it works

Last seen on 15:16, 19. Apr 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I did this procedure if u…
Mon, 10/31/2022 - 13:52

I did this procedure if u need:

 

I think this is what u want to do, if player right clicks with item in main hand it deals 1 damage to the item and then strike lightning (i used 100 while it's too low 50 for me you can put how many blocks you want). You can use the same procedure but change the item if you want.
And the item is going on cooldown only if the lightning strikes now.