I need some help to fix or understand this... ;w; [SOLVED]

Started by AmadeusByakko on Mon, 07/19/2021 - 08:20

Topic category: Help with modding (Java Edition)

Last seen on 16:31, 21. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I need some help to fix or understand this... ;w; [SOLVED]
Mon, 07/26/2021 - 03:33 (edited)

Hi, srry bros but i need some help here.

[MCreator 2020.5]

When I use the procedure block named "Set item in main-hand" or "Set item in main-hand" just not work.

I have confirmed that the function reaches that point, and it does, it is simply that the procedure block does not do its job.

code 1

I also have another function that what it does is the following:

When a specific item is broken, add a different one to the inventory.

however the procedure called "add Item to inventory" does not work and the only solution I found is to call this procedure 2 times.
but this only adds a copy of the specified Item to my character's inventory.

Code 2

 

(I speak spanish... srry for mistakes)

Edited by AmadeusByakko on Mon, 07/26/2021 - 03:33
Last seen on 13:15, 9. Sep 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
  1, Try removing the local…
Mon, 07/19/2021 - 10:26

 

1, Try removing the local var and I think you you dont need the "else if" statement/flow. Try using just the "if / do" flow only.  

 

2, I dont think the "provided itemstack" block will be able to tell if your item is damaged. 

 

Chew

Last seen on 16:31, 21. Aug 2021
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I understand that I can…
Mon, 07/19/2021 - 22:12

I understand that I can optimize the code, however, I still have the question, because heck the procedure block that adds things in the inventory does not work.

It is very annoying and I want to know if it is my editor version or if it is my error.

I say it because I know that the code reaches that point, the message is printed in the chat,
and yet the procedure blocks that add items and replace items do not work.

Last seen on 20:53, 28. Jul 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
use entity swing trigger of…
Sun, 07/25/2021 - 19:00

use entity swing trigger of the item then:

if get damage of (item in main hand) of event/target-entity >/= (your max.Itemdamage - 1)

                       Set Item in main hand of event/target-entity to 1 (your replacement Item)

Last seen on 20:53, 28. Jul 2021
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Also i stared at the upper…
Mon, 07/26/2021 - 18:24

Also i stared at the upper picture for quite some time already, but i still dont understand what its supposed to do.