-
Recently Browsing
No registered users viewing this page.
-
Posts
-
Okay so I'm trying to join one of my friends modded server and it said that illegal state of wheat was stopping me from joining
-
By MrNoodles75 · Posted
@Draco18s I have been figuring everything out since then, by going through the default code and getting information on how to do something -
By AntonBespoiasov · Posted
public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) { Entity entity = ModMath.getMouseOver(Minecraft.getMinecraft().getRenderPartialTicks(), 0); // Gets entity that entityLiving is looking at if (entity != null && entity instanceof EntityLiving) { ((EntityLiving)entity).attackEntityFrom(DamageSource.MAGIC, 2.0f); ((EntityLiving)entity).setRevengeTarget(entityLiving); } return stack; } Using item that has the implementation of the method above doesn't damage entity. Debugging it showed that attackEntityFrom() is called, code within if statement is executed but entity isn't attacked. I looked into Minecraft's files that use attackEntityFrom() and observed that they just call attackEntityFrom(), just one line of code(I assume that something else that can affect entity attacking process was called before attackEntityFrom() in that files). How can I solve this problem? How can I deal damage to entity? -
Objects, inheritance, overriding, methods, variables, singletons, event driven design, and probably a bunch more. "Learning how to search for answers" being a very valuable tool regardless of what language you're working with (for instance, I see and vote-to-close-as-duplicate "I got this error it said something about null references?" question on Stack Overflow about twice a day).
-
Topics
-
Who's Online (See full list)