UnPushable Villager (1.7.4)

Discussion in 'Spigot Plugin Development' started by LordsTeam, Jul 27, 2018.

Thread Status:
Not open for further replies.
  1. Hey,

    I have Overriden the move methode of the Entity.class and try now to spawn an Entity. But the mc crash


    Code (Java):
    package net.Tesy.Lobby.utils.NMS;

    import net.minecraft.server.v1_7_R4.EntityVillager;
    import net.minecraft.server.v1_7_R4.World;

    public class QuestEntity extends EntityVillager{

        public QuestEntity(World world) {
        public void g(){


    Code (Java):
    package net.Tesy.Lobby.commands;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.craftbukkit.v1_7_R4.CraftWorld;
    import org.bukkit.entity.CreatureType;
    import org.bukkit.entity.Player;
    import org.bukkit.entity.Villager;
    import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
    import org.bukkit.metadata.FixedMetadataValue;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;

    import net.Tesy.Lobby.utils.NMS.QuestEntity;
    import net.Tesy.Lobby.utils.NMS.RidableVillager;
    import net.minecraft.server.v1_7_R4.World;

    public class Spawn implements CommandExecutor{

        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

              if(cmd.getName().equalsIgnoreCase("spawn") || cmd.getName().equalsIgnoreCase("spawnit")) {
                  Player P1 = (Player)sender;

                  final Location loc = P1.getLocation();
                  this.loc = loc;


            return false;
        private QuestEntity v;
        private Location loc;
          public void spawn(){
              QuestEntity qe = new QuestEntity(((CraftWorld)loc.getWorld()).getHandle());
              this.v = qe;
              Villager vill = (Villager)qe.getBukkitEntity();
              qe.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(),loc.getPitch());
              ((CraftWorld) loc.getWorld()).getHandle().addEntity(qe,SpawnReason.CUSTOM);
             // qe.teleportTo(loc, true);
              vill.setCustomName(ChatColor.translateAlternateColorCodes('&', "YESS"));
              vill.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, Integer.MAX_VALUE, 255));


    Whats is the problom ? , Thanks <3
  2. Holy moly, December 10, 2013 its legit been almost 6 years and you're still not updating??

    1. Package names are meant to be fully lowercase
    2. Create a custom entity Villager and use the g() nms method. (you need to provide an EntityInsentient into the g() method)
    3. Update your jar and server (its time to move on...)
  3. my server versions 1.7x 1.8x .-.
    but still many networks using 1.7x :c
  4. many networks still sue 1.8.X
    I haven't seen or heard of a 1.7 server in ages. the only time i see them is when playing on a modded server.
  5. FrostedSnowman

    Resource Staff

    im sorry, do you own a network with a 1000+ player base?
  6. no, 50 players base
    • Funny Funny x 1
  7. {NoAI:1} tag in NBT works. IDK about this.
Thread Status:
Not open for further replies.