vanilla mob attack modded mobs

Started by a23709g3 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
vanilla mob attack modded mobs

how do i make vanilla mobs attack my modded mobs?

Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I’m also trying to figure…
Mon, 08/28/2023 - 00:40

I’m also trying to figure this out

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know a way that uses code…
Mon, 08/28/2023 - 01:53

I know a way that uses code snippets. 

Trigger: on spawn

if event/target entity is sub type of (Mob Type):

  code snippet: ((IronGolem)entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((IronGolem)entity, ExampleEntity.class, false, false));

# Replace IronGolemEntity with the id of a mob, like using /summon but make the first letter capital then where theres a _ remove it and make the letter a capital then finally add Entity at the end. Same goes for ExampleEntity

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Iron golem Would be the mob…
Wed, 08/30/2023 - 01:38

Iron golem Would be the mob type in this example.

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried replacing IronGolem…
Sat, 09/23/2023 - 17:27

I tried replacing IronGolem with Cat, and Example with CreeperSprout, but it gave me this error:

 

Executing Gradle task: build
Build info: MCreator 2023.3.36712, forge-1.20.1, 64-bit, 8192 MB, Mac OS X, JVM 17.0.7, JAVA_HOME: /Applications/MCreator.app/Contents/jdk.bundle/Contents/Home, started on: 2023-09-23-12:25:45

> Task :compileJava FAILED
/Users/Drake/MCreatorWorkspaces/creeper_spread/src/main/java/net/mcreator/creeperspread/procedures/WhenCreeperSproutSpawnsProcedure.java:10: error: cannot find symbol  ((Cat) entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((Cat) entity, CreeperSproutEntity.class, false, false));
           ^
symbol: variable entity
location: class WhenCreeperSproutSpawnsProcedure
/Users/Drake/MCreatorWorkspaces/creeper_spread/src/main/java/net/mcreator/creeperspread/procedures/WhenCreeperSproutSpawnsProcedure.java:10: error: cannot find symbol  ((Cat) entity).targetSelector.addGoal(1, new NearestAttackableTargetGoal((Cat) entity, CreeperSproutEntity.class, false, false));
  ^
symbol: variable entity
location: class WhenCreeperSproutSpawnsProcedure
2 errors
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 5s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 43 seconds

 

What did I do wrong?