Posted April 28, 20214 yr I created an entity, and when I try to summon it I just get "An unexpected error occurred trying to execute that command" with no stack trace or anything. Why is this happening? My code: https://github.com/AyliasTheCoder/BlocksRealsBlockCreatures The Entity Class Itself: https://github.com/AyliasTheCoder/BlocksRealsBlockCreatures/blob/master/src/main/java/me/aylias/minecraft/mods/modbase/entities/HayHorse.java Edited April 28, 20214 yr by NullDev It was solved!
April 28, 20214 yr Author 11 minutes ago, diesieben07 said: Use the debugger to find the issue. I ran it in debug mode in intellij but the console still says nothing but "An unexpected error occurred trying to execute that command"
April 28, 20214 yr Author 32 minutes ago, diesieben07 said: Well, you have to put a breakpoint at the place where that error occurs and see why. I have done that, and stepped through it, but I cannot figure out how to understand most of what it says. I updated the github w/ the MDK's .gitignore. https://github.com/AyliasTheCoder/BlocksRealsBlockCreatures
April 28, 20214 yr Author 4 minutes ago, diesieben07 said: You need to register the attributes for your entity using EntityAttributeCreationEvent. I have this in my EntityRegisterEvents class: @SubscribeEvent public static void registerEntityAttributes(EntityAttributeCreationEvent e) { e.put(HAY_HORSE, AttributeModifierMap.createMutableAttribute().createMutableAttribute(Attributes.MAX_HEALTH, 25) .createMutableAttribute(Attributes.FOLLOW_RANGE, 16.0) .createMutableAttribute(Attributes.ARMOR) .create()); } https://github.com/AyliasTheCoder/BlocksRealsBlockCreatures/blob/master/src/main/java/me/aylias/minecraft/mods/modbase/events/EntityRegisterEvents.java Is something missing from it?
April 28, 20214 yr Author Quote Is something missing from it? Yes, there was. I forgot a few attributes, namely Attributes.MOVEMENT_SPEED and Attributes.HORSE_JUMP_STRENGTH. Thank you for you help!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.