NullDev Posted April 28, 2021 Posted April 28, 2021 (edited) 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, 2021 by NullDev It was solved! Quote
NullDev Posted April 28, 2021 Author Posted April 28, 2021 On 4/28/2021 at 9:19 PM, diesieben07 said: Use the debugger to find the issue. Expand I ran it in debug mode in intellij but the console still says nothing but "An unexpected error occurred trying to execute that command" Quote
NullDev Posted April 28, 2021 Author Posted April 28, 2021 On 4/28/2021 at 9:33 PM, diesieben07 said: Well, you have to put a breakpoint at the place where that error occurs and see why. Expand 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 Quote
NullDev Posted April 28, 2021 Author Posted April 28, 2021 On 4/28/2021 at 10:20 PM, diesieben07 said: You need to register the attributes for your entity using EntityAttributeCreationEvent. Expand 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? Quote
NullDev Posted April 28, 2021 Author Posted April 28, 2021 Quote Is something missing from it? Expand Yes, there was. I forgot a few attributes, namely Attributes.MOVEMENT_SPEED and Attributes.HORSE_JUMP_STRENGTH. Thank you for you help! Quote
Recommended Posts
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.