Posted October 14, 20186 yr [removed] Edited November 29, 20186 yr by Robin Withes asdfsdafsadfasdfsafsadf sad fasdf sdaf
October 14, 20186 yr EntityLivingBase#addPotionEffect. You can't add a PotionEffect to an Entity since Entity objects can't have them in the first place. Only the descendants of EntityLivingBase may have potion effects.
October 14, 20186 yr Author 2 minutes ago, V0idWa1k3r said: EntityLivingBase#addPotionEffect. You can't add a PotionEffect to an Entity since Entity objects can't have them in the first place. Only the descendants of EntityLivingBase may have potion effects. I dont get the difference between the 2?
October 14, 20186 yr They are different classes. An EntityPig is a descendant of EntityLivingBase, but EntityItem or EntityArrow isn't.
October 14, 20186 yr Author 30 minutes ago, V0idWa1k3r said: They are different classes. An EntityPig is a descendant of EntityLivingBase, but EntityItem or EntityArrow isn't. That's peculier then because i am trying to add a effect to a creeper, which should be possible then right? I have a creeper stored into a entity object, can i convert it to entitylivingbase somehow? Edited October 14, 20186 yr by Robin Withes sdf asdf sadf sad f
October 14, 20186 yr 30 minutes ago, Robin Withes said: That's peculier then because i am trying to add a effect to a creeper, which should be possible then right? Yes it is.
October 14, 20186 yr 30 minutes ago, Robin Withes said: I have a creeper stored into a entity object, can i convert it to entitylivingbase somehow? Casting. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
October 14, 20186 yr Author 4 minutes ago, V0idWa1k3r said: Yes it is. Well but i cant, @SubscribeEvent public void entitySpawned(EntityJoinWorldEvent event) { Entity entity = event.getEntity(); if (MonsterConfig.isEnhancedMob(entity.getDisplayName().getUnformattedText()) && !entity.isDead) { //Add potion effect to entity here } } This is my event currently, i have no idea how to convert the entity to a entitylivingbase. 3 minutes ago, Draco18s said: Casting. No idea what that means, i already tried this: EntityLivingBase entityLivingBase = (Entity) entity; Edited October 14, 20186 yr by Robin Withes more clarifi
October 14, 20186 yr 8 minutes ago, Robin Withes said: No idea what that means Well then you should probably learn java before starting to make mods. Otherwise you are trying to assemble a rocket without a guide.
October 14, 20186 yr Author [removed] Edited November 29, 20186 yr by Robin Withes asdfsadf sdaf asdf sadf asdfs
October 14, 20186 yr 21 minutes ago, Robin Withes said: EntityLivingBase entityLivingBase = EntityLivingBase.class.cast(entity); This is still not the right way to cast things. 21 minutes ago, Robin Withes said: Hope your ego trip was fun This is not about mine or anyoneelses ego. This is about you and your coding. If you don't know the language you are using you won't be able to do much. You will encounter issues you won't be able to solve because you don't know how, like right now. And you will come to this forum again asking a question that can be solved just by knowing the language. And we will have to tell you the same thing I am telling you right now - learn java before starting to mod. You WILL have issues.
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.