Help Transferring Ownership from one entity to another

Started by SilentStarling on

Topic category: Advanced modding

Last seen on 01:15, 25. Jul 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help Transferring Ownership from one entity to another

I am trying to make a procedure to allow the aging of a baby mob into an adult mob, while transferring all of the information from the baby entity to the adult entity. So far it is transferring the health and name properly, but I cannot get it to transfer ownership. Meaning, I am trying to tame the adult mob to the same person the baby mob is tamed to, if any. I tried using the "tame x by y" procedure, with X being the adult entity and Y being "get owner of baby entity if tamed". I get the following console errors from this:

 

> Task :compileJava
D:\MocTest\src\main\java\net\mcreator\mocreatures\procedures\TurtleGrowProcedure.java:101: error: cannot find symbol && (((entity instanceof TameableEntity) ? ((TameableEntity) entity).getOwner() : null) instanceof PlayerEntity)) {
^
symbol: variable entity
location: class net.mcreator.mocreatures.procedures.TurtleGrowProcedure
D:\MocTest\src\main\java\net\mcreator\mocreatures\procedures\TurtleGrowProcedure.java:101: error: cannot find symbol && (((entity instanceof TameableEntity) ? ((TameableEntity) entity).getOwner() : null) instanceof PlayerEntity)) {
^
symbol: variable entity
location: class net.mcreator.mocreatures.procedures.TurtleGrowProcedure
D:\MocTest\src\main\java\net\mcreator\mocreatures\procedures\TurtleGrowProcedure.java:103: error: cannot find symbol ((TameableEntity) adult).setTamedBy((PlayerEntity) ((entity instanceof TameableEntity) ? ((TameableEntity) entity).getOwner() : null));
^
symbol: variable entity
location: class net.mcreator.mocreatures.procedures.TurtleGrowProcedure
D:\MocTest\src\main\java\net\mcreator\mocreatures\procedures\TurtleGrowProcedure.java:103: error: cannot find symbol ((TameableEntity) adult).setTamedBy((PlayerEntity) ((entity instanceof TameableEntity) ? ((TameableEntity) entity).getOwner() : null));
^
symbol: variable entity
location: class net.mcreator.mocreatures.procedures.TurtleGrowProcedure
4 errors
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 18s
1 actionable task: 1 executed

BUILD FAILED

I made sure both entities are set to tameable in the AI tab, and they are. So I'm not sure what the error is coming from or how to fix it. Any ideas?

Last seen on 04:04, 3. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ive read it 4 times and…
Thu, 04/07/2022 - 05:38

ive read it 4 times and still have no idea