Use minecraft commands in plugins

Discussion in 'Spigot Plugin Development' started by BumseBine, Jun 24, 2018.

  1. I want to have an easy Villager Shop with the default Villager Inventory. I have the command to summon it but I don't know how to do it with spawnEntity so I want to just use the /summon command. Is there a way to execute commands in the api?
     
  2. What's wrong with spawnEntity? It works fine, just get your world and call "World#spawnEntity(Location, EntityType)".
     
  3. I dont know how to assign the diffrent values to the villager. It should trade some Items for a Skyblock plugin and not only some random that you can find in the usual villager
     
  4. if you really want to do it that way look in to

    getServer().getCommandSender();

    and getServer().dispatchCommand();
     
  5. You mean modify the Villagers trade values?
    Quick Google search easily pops up with many results.