Make Entity attack Entity

Discussion in 'Plugin Development' started by goodstuff20, Apr 14, 2014.

Thread Status:
Not open for further replies.
  1. Hi guys,

    I have tried allot and cant seem to fix it (.target() doesnt seem to work so i tried to set the yaw and pitch to make the entity look on the other entity with atan etc... and then attack - still they seem to not give a damn).

    Anyways i hope u guys have an answer :)

    Cheers
     
  2. Offline

    jensdeboom

    Do u want it to do with players or mobs? For players i don't think you can make a player attack an entity but you could damage the entity, apply a velocity and set the player as the damager. For mobs it can be done with lms i think (im not good with lms tho)

    ~jens
     
  3. Offline

    malandrix_bunny

    NMS can be used to do this. Essentialy you would change their goal of attacking humans to attacking other entities.
     
  4. Offline

    jensdeboom

  5. jensdeboom yeh entity against entity - (you cant force a player to attack lol) and thanks malandrix_bunny ill check into it
     
  6. When you're using setTarget() for a Monster, the reason it probably doesn't "give a damn" is because it automatically sets its target back to the nearest player. You could listen to EntityTargetLivingEntityEvent and check if the entity is that Monster you set target, and then check if event.getTarget() or whatever is the entity that the Monster is meant to target.
     
  7. thanks but ill stick with NMS - its got tons of good features

    umm if i want to change the arrows in the EntiySkeleton class i seem to get errors (in the method "publicvoida(EntityLivingentityliving,floatf)")

    it says setKnockbackStrength doesnt exist
    HereĀ“s the original:
    https://github.com/SpigotMC/mc-dev/blob/master/net/minecraft/server/EntitySkeleton.java

    nvm got it

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
    KingFaris11 likes this.
  8. Offline

    malandrix_bunny

    Only problem with using NMS is your going to have to update A LOT. Also you won't find much help on it anywhere.
     
  9. yeh malandrix_bunny - but i cant find a much better alternative - im working on a projekt where i need allot of different mobs with different stats (damage, health, speed, target) and NMS is good at that - although i cant figure how to have more for ex. zombie classes and spawn both same time - do u know how to spawn a customentity (i mean yes it works from a zombie egg or just spawning a zombie cause it gets overridden but - if i would like to only have that zombie or 2 different same time....) thanks
     
  10. Offline

    malandrix_bunny

    Yeah, I see what you mean now. I'm not really good at NMS seeming I have no reason to fool around with it right now :/ Good luck though.
     
Thread Status:
Not open for further replies.

Share This Page