Doing a free plugin or two this weekend, comment for a copy then PM me the details, I'll reply on this thread if I accept it.
No, I'm just trying to get some easy rep, but if you wanna work something out, you can hire me.Does this include semi complex plugins?
I need a villager NPC (cant move and never die) which when right clicked will say in chat 'Hello there'
Citizens
Yes, I havent accepted any yet, no one has had a chance to give me their details.Are you still doing free plugin?
I am looking for the code so I can use it in a custom plugin.Citizens
I would create a villager entity with the spigot api and give it a custom name. Look through it's methods and I think theirs an indestructible method or invincible, either way check the javadocs and it'll tell you. Then you just have to make a listener that cancels any click event when you click on an entity with that specific name and also runs whatever other code you need ran such as sending the player a message "Hello there".I am looking for the code so I can use it in a custom plugin.
I am having issues with NMS which spawns in NPC
or ya know, just make a custom entity.. NMS is not hard at all ._.
Witch w = (Witch) p.getWorld().spawnEntity(p.getLocation(), EntityType.WITCH);
w.setCustomName(nColor.convert("&5&lWitch Shop"));
try {
Object NMS_WITCH = w.getClass().getMethod("getHandle").invoke(w);
Object tag = NMS_WITCH.getClass().getMethod("getNBTTag").invoke(NMS_WITCH);
if (tag == null) tag = getNMSClass("NBTTagCompound").newInstance();
NMS_WITCH.getClass().getMethod("c", getNMSClass("NBTTagCompound")).invoke(NMS_WITCH, tag);
tag.getClass().getMethod("setInt", String.class, int.class).invoke(tag, "NoAI", 1);
NMS_WITCH.getClass().getMethod("f", getNMSClass("NBTTagCompound")).invoke(NMS_WITCH, tag);
} catch (Exception e) {
e.printStackTrace();
sender.send("&4&lFAILED TO SET NOAI VARIABLE");
w.remove();
return;
}
import net.minecraft.server.v1_8_R3.*;
public class Witch extends EntityWitch {
public Witch(World world) {
super(world);
}
@Override
public void move(double d0, double d1, double d2) {
}
@Override
public void setOnFire(int i) {
}
@Override
protected boolean d(DamageSource damagesource, float f) {
return false;
}
@Override
public boolean a(EntityHuman entityhuman, Vec3D vec3d) {
return false;
}
}
