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

Started by AmadeusByakko on

Topic category: Help with Minecraft modding (Java Edition)

Active 4 years ago
Joined Jul 2021
Points:
589

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 17
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
Active 5 months ago
Joined May 2021
Points:
751

User statistics:

  • Modifications: 2
  • Forum topics: 15
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 171
  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

Active 4 years ago
Joined Jul 2021
Points:
589

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 17
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.

Active 3 months ago
Joined Oct 2020
Points:
642

User statistics:

  • Modifications: 2
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 26
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)

Active 3 months ago
Joined Oct 2020
Points:
642

User statistics:

  • Modifications: 2
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 26
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.