How do I fix the "Failed to load dependency entity for procedure" for my procedures?

Started by AnTDD on

Topic category: Help with modding (Java Edition)

Last seen on 13:22, 14. Oct 2018
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I fix the "Failed to load dependency entity for procedure" for my procedures?

Hello, I am using MCreator  version 1.8.0. I keep getting the "Failed to load dependency entity for procedure" error. Here is what it says in the console:[15:51:39] [Server thread/INFO] [STDERR]: [mod.mcreator.mcreator_myplantPlanted:executeProcedure:24 Failed to load dependency entity for procedure myplantPlanted!

[15:50:20] [Server thread/INFO] [STDERR]: [mod.mcreator.mcreator_myplantDropSeed:executeProcedure:20 Failed to load dependency entity for procedure myplantDropSeed!

IDK if it is a bug or if I am just stupid but I don't see anything wrong with the code that I have.

Here is the code for myplantDropSeed:

https://imgur.com/WKIg7X5

Here is the code for myplantPlanted:

https://imgur.com/zk15B0n

Thank you in advance for your help.

 

Last seen on 03:03, 6. Feb 2024
Joined Apr 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is a bug of some sort…
Fri, 10/26/2018 - 23:12

This is a bug of some sort recreate your procedure and try then 

Last seen on 23:46, 4. Jan 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found what may be the…
Wed, 01/04/2023 - 00:28

I found what may be the issue, if you go into the code itself, you can see the dependencies, and sourceentity is not provided for some reason!

(I used the on entity death event, same arguments)

public void onEntityDeath(LivingDeathEvent event) {
        if (event != null && event.getEntity() != null) {
            Entity entity = event.getEntity();
            int i = (int) entity.posX;
            int j = (int) entity.posY;
            int k = (int) entity.posZ;
            World world = entity.world;
            java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
            dependencies.put("x", i);
            dependencies.put("y", j);
            dependencies.put("z", k);
            dependencies.put("world", world);
            dependencies.put("entity", entity);
            dependencies.put("event", event);
            this.executeProcedure(dependencies);
        }
    } 

sourceentity is not provided, though here it is required:

if (dependencies.get("sourceentity") == null) {
            System.err.println("Failed to load dependency sourceentity for procedure BloodKill!");
            return;
        } 

Last seen on 23:46, 4. Jan 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This line of code seemed to…
Wed, 01/04/2023 - 00:30

This line of code seemed to help:

dependencies.put("sourceentity", event.getSource());

Last seen on 23:46, 4. Jan 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Nevermind, I can't find the…
Wed, 01/04/2023 - 20:36

Nevermind, I can't find the variable to put into this dependency. The event.getSource() did not return an entity

Last seen on 23:46, 4. Jan 2023
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the real fix is …
Wed, 01/04/2023 - 20:45

the real fix is 

dependencies.put("sourceentity", event.getSource().getTrueSource());