Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.hub.black;
- import org.bukkit.Bukkit;
- import org.bukkit.GameMode;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.World;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.inventory.PlayerInventory;
- public class hub implements CommandExecutor {
- private FileConfiguration config;
- private Main pl;
- public hub(Main main){
- this.pl = main;
- this.config = pl.getConfig();
- }
- public hub() {
- // TODO Auto-generated constructor stub
- }
- @Override
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(sender instanceof Player){
- Player player = (Player) sender;
- int x = config.getInt("locations.x.");
- int y = config.getInt("locations.y.");
- int z = config.getInt("locations.z.");
- String monde = config.getString("World.");
- World world = Bukkit.getWorld(monde);
- player.sendMessage("coucou");
- player.teleport(new Location(world, x, y, z));
- PlayerInventory pi = player.getInventory();
- player.sendMessage("Salut"+x+y+z);
- player.getInventory().clear();
- pi.addItem(new ItemStack(Material.DIAMOND));
- player.setGameMode(GameMode.CREATIVE);
- config.set("locations.x", x);
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement