Skip to content

Instantly share code, notes, and snippets.

@cacciatc
Last active December 12, 2015 10:09
Show Gist options
  • Save cacciatc/4757168 to your computer and use it in GitHub Desktop.
Save cacciatc/4757168 to your computer and use it in GitHub Desktop.
Bukkit Villager spawn.
spawn:function(){
var player = getPlayerObject();
var world = player.getWorld();
// create a villager
var quest_npc = world.spawnCreature(player.getLocation().add(1,0,0), org.bukkit.entity.EntityType.VILLAGER);
quest_npc.setProfession(org.bukkit.entity.Villager.Profession.PRIEST);
quest.store.npcs[quest_npc.getUniqueId()] = quest_npc;
// listen for interaction events
events.on("player.PlayerInteractEntityEvent",this.proc_quest);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment