Is it possible to make an Item that if in inventory or worn you get one heart deleted? If yes how?

Started by LOLBroSave on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to make an Item that if in inventory or worn you get one heart deleted? If yes how?

So I’m very new at this. I wanted to make an Item if you have it in inventory or as armor you get one heart deleted, but you get strenght. I know how to give effects, but I dont´t know how to delete hearts for example from 10 to 9 hearts(so you canˋt regenerate the heart), I would like to do it that it could stack, so if I have two of it I get two hearts deleted (not the Item should stack, the heart delete should stack) It would be very nice to get some help. Thanks in advance :)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is one way I am…
Tue, 10/22/2024 - 17:20

There is one way I am working on I will reply when finished

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Event Trigger set number …
Tue, 10/22/2024 - 17:30

Event Trigger

set number  Local: Number(VariableName) to 0

if has entity/player in inventory (Your damage item)

       repeat 27 times (one per inventory slot)

               if get copy of item in slot (Number) of entity/player if it has inventory =  (Your item) these blocks are red.

                      set local number NumberofItems(Number of damage items) NumberofItems + 1

                      set local number Number to Number +  1

                else 

                       set local number Number to Number + 1

        set health of entity/player to [(max health of entity/player) - (get local number NumberOfItems)]

 

 

This section of code is not tested so I have no idea if it works but it should.

Hope this helps

 

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you send a picture?
Wed, 10/23/2024 - 11:55

Could you send a picture?

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I can't sorry. But there is…
Wed, 10/23/2024 - 12:28

I can't sorry. But there is a search bar for blocks in mcreator on the top left and my showing of the code is excact wording.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here I don't know if the…
Wed, 10/23/2024 - 12:33

Here I don't know if the image shows up

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When I click on your link I…
Fri, 10/25/2024 - 05:28

When I click on your link I only see nothing found, but still thank you that you tried to help me