#KitPvP per world kit

1 messages · Page 1 of 1 (latest)

lilac bluff
#

Hi, im working on a plugin that has a per world kit for ffa, should work as following:
When a player enters a specific world, they get a kit.
The problem is, that when entering the world they do not get the kit
Im pretty new to coding btw

#

Main class code: ```package eu.nuhgi.zonesiusffa;

import org.bukkit.plugin.java.JavaPlugin;

public final class ZonesiusFFA extends JavaPlugin {

@Override
public void onEnable() {
    // Plugin startup logic

    this.getServer().getPluginManager().registerEvents(new SwordFFA(), this);

}

@Override
public void onDisable() {
    // Plugin shutdown logic
}

}

#

SwordFFA class code: ```public class SwordFFA implements Listener {

public void onPlayerJoin(PlayerJoinEvent event) {
    Player player = event.getPlayer();
    World world = player.getWorld();

    // KIT

    ItemStack sword = new ItemStack(Material.DIAMOND_SWORD);
    ItemMeta swordMeta = sword.getItemMeta();
    swordMeta.setUnbreakable(true);
    sword.setItemMeta(swordMeta);

    ItemStack helmet = new ItemStack(Material.DIAMOND_HELMET);
    helmet.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
    ItemMeta helmetMeta = helmet.getItemMeta();
    helmetMeta.setUnbreakable(true);
    helmet.setItemMeta(helmetMeta);

    ItemStack chestplate = new ItemStack(Material.DIAMOND_CHESTPLATE);
    chestplate.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
    ItemMeta chestplateMeta = chestplate.getItemMeta();
    chestplateMeta.setUnbreakable(true);
    chestplate.setItemMeta(chestplateMeta);

    ItemStack leggings = new ItemStack(Material.DIAMOND_LEGGINGS);
    leggings.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
    ItemMeta leggingsMeta = leggings.getItemMeta();
    leggingsMeta.setUnbreakable(true);
    leggings.setItemMeta(leggingsMeta);

    ItemStack boots = new ItemStack(Material.DIAMOND_BOOTS);
    boots.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 3);
    ItemMeta bootsMeta = boots.getItemMeta();
    bootsMeta.setUnbreakable(true);
    boots.setItemMeta(bootsMeta);



    if(world.equals("swordffa")) {
        PlayerInventory inv = player.getInventory();

        inv.setHelmet(helmet);
        inv.setChestplate(chestplate);
        inv.setLeggings(leggings);
        inv.setBoots(boots);
        inv.addItem(sword);

    }

}

}

lilac bluff
#

ah

#

nope