1

I'm looking into making some minigames, and I'm not sure how it would work, but Is it possible to make villagers aggressive/evil in vanilla Minecraft?. I'm looking for hurting the player, but also other traits that will give the player the impression that the villagers are unfriendly.

I cannot think how this would be accomplished, but I have seen other seemingly impossible tasks answered here. Any ideas for how I might get this to work, or at least to get me started?

  • 6
    Evil, as in, they try to attack the player? – peper757 Feb 12 '16 at 23:15
  • I don't see the question clearly... – spund3 Feb 12 '16 at 23:20
  • I'm looking for hurting the player, but surrounding them like a mob would, might also work. – Jason_ Feb 12 '16 at 23:33
3

As of 1.9, if a mob is the passenger of another mob, it will take over pathfinding. For example, the following summons a creeper riding a villager, in which the creeper will cause the villager to pathfind towards the player as its target:

/summon Villager ~ ~1 ~ {Passengers:[{id:"Creeper"}]}

If the creeper itself is capable of attacking, it will attempt to when within range. This only affects pathfinding and the villager itself will not do any attacking.

Another example, using an invisible creeper:

/summon Villager ~ ~1 ~ {Passengers:[{id:"Creeper",ActiveEffects:[{Id:14b,Duration:2147483647,ShowParticles:0b}]}]}
  • Skylinerw, your answer is easy to understand, but due to my computer being unable to use the new snapshots I want to completely clarify. Will the Creeper be visible to the player if so do you know of a way to hide it? – Jason_ Feb 14 '16 at 3:42
  • @Jason_ You can apply the Invisibility effect to hide the creeper. There are a number of different tags you may also want to apply, but it's totally up to you. I recommend checking the wiki for a list of tags here. I've edited my post to include an example of a creeper with invisibility. – Skylinerw Feb 14 '16 at 6:41
  • Great that answers all my questions for this post – Jason_ Feb 14 '16 at 7:05
  • I tryed using an invisible skeleton on top of a villager, but the villager was suddenly very fast. Anything weird about that? – JohnnyBobMan Aug 26 '16 at 14:56
  • @JohnnyBobMan That's normal; the villager is taking on the movement AI of the skeleton while still using the generic.movementSpeed attribute of the villager. How the attribute's value determines speed is not consistent between mobs, so the value that the villager has would make the skeleton move much faster. You'd have to modify the villager's movement speed attribute to be lower to compensate for the skeleton. – Skylinerw Aug 26 '16 at 16:23
1

If you mean cause them to become hostile, and attack the player, no, that's not possible. Villagers are passive mobs, and will flee if attacked.

As an aside, you also get Iron Golems in villages, and they will become aggressive if you attack them, or a villager, or if you have very low popularity.

For completeness, there are various mods (Hostile Villagers, Defensive Villagers) which do what you're asking, but this obviously does not help in Vanilla.

  • You can't make the villager itself hostile, but you can simulate its hostility. Don't post "you can't" answers unless you're entirely sure you can't. A zombie riding a villager is pmuch the same thing. Or he could replace the villagers with retextured zombie villagers. – rustphoenix Feb 13 '16 at 19:00
  • @sharpturn - Um, I was entirely sure. And I don't think something riding a villager (which as far as I know isn't even possible in 1.8) is the same thing at all. As for when to post, your unsolicited advice is neither correct nor necessary. Perhaps you're new here. If my answer is poor, it will be downvoted or ignored. – ire_and_curses Feb 14 '16 at 6:06
  • ... Since the Riding tag, you could have any entity ride any entity. Since 1.9, upper mob always gets control over movement. minecraft.gamepedia.com/Chunk_Format. "Unsolicited advice" is an odd choice of words. Should I have asked you if you thought you were wrong? You certainly seem awfully sure of yourself, so I doubt evidence from thousands of experiments done over the course of decades (if it existed) could've brought reason to your attention, let alone subtle hinting. My post was both correct and necessary, but blindness is an incurable affliction. – rustphoenix Feb 14 '16 at 6:39
  • @sharpturn - Thanks for the info about the tag, that's helpful. No, you needn't have asked. What you should have done is kept your opinion to yourself. I don't understand the rest of your ramble, but that's ok. Feel free to educate yourself on the meta before wasting anyone else's time. Best of luck learning how the system works! – ire_and_curses Feb 14 '16 at 21:13
  • Sorry if I was rude, just going through some stuff right now. – rustphoenix Feb 14 '16 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.