Is it possible to make other mobs "attack each other?" I need that for a script I am making, and I was wondering if anyone could help. I understand modpe, I just need help
THANK YOU!
Rollback Post to RevisionRollBack
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
Make yourself a method that can constantly get the difference between their relative position, and use Entity.setVelX(), Y(), and Z(), to move them toward each other, and use Entity.setHealth() to have them hurt each other, also, have some sound effects with Level.playSoundEnt();
Rollback Post to RevisionRollBack
Back to modding! Follow me on Twitter @byteandahalf
Make yourself a method that can constantly get the difference between their relative position, and use Entity.setVelX(), Y(), and Z(), to move them toward each other, and use Entity.setHealth() to have them hurt each other, also, have some sound effects with Level.playSoundEnt();
I know everything else besides how I test their relative position. I haven't made a script in a long time need help and reminders... I feel stupid lol.. just please show me your idea of it... sorry I keep asking questions..
Rollback Post to RevisionRollBack
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
I meant how to get the difference between the two entities.
Entity.getX, Entity.getY, Entity.getZ gets position of entity. Subtract to get difference. You can use Pythagoras' theorem to find the magnitude of the difference.
THANK YOU!
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
Back to modding! Follow me on Twitter @byteandahalf
I know everything else besides how I test their relative position. I haven't made a script in a long time need help and reminders... I feel stupid lol.. just please show me your idea of it... sorry I keep asking questions..
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
I meant how to get the difference between the two entities.
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
Entity.getX, Entity.getY, Entity.getZ gets position of entity. Subtract to get difference. You can use Pythagoras' theorem to find the magnitude of the difference.
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246