Last active
December 12, 2015 10:09
-
-
Save cacciatc/4757168 to your computer and use it in GitHub Desktop.
Bukkit Villager spawn.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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