Posted April 20, 20178 yr Hello everyone! I have the following code snippet that's supposed to make a "robot" called _scriptedEntity in-game turn to face a given Entity called "entity" and attack the entity if the _scriptedEntity is within range.. I can not for the life of me how ever understand what .swingarm is supposed to do? my thought was that I could use the method to achieve the swinging arm animation of _scriptedEntity.. how ever I don't understand what actual parameters .swingarm is supposed to have and why? _scriptedEntity extends entityCreature tl:dr; How do I animate _scriptedEntity to swing his arm? @Override public void attack(Entity entity){ //turn and face entity this._scriptedEntity.faceEntity(entity,360.0f,360.0f); //attack target if (this.getDistanceTo(entity) <3.0) { //swing animation.... wait wat? this._scriptedEntity.swingArm(); //give damage entity.getWrappedEntity().attackEntityFrom(DamageSource.GENERIC, 1.0f); } } Edited April 20, 20178 yr by andr4826
April 25, 20178 yr Does your IDE give errors under swingArm? Hover over it and it should give you parameters. Apparently I'm addicted to these forums and can't help but read all the posts. So if I somehow help you, please click the "Like This" button, it helps.
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.