forum Forumsplay_arrow Minecraft fiber_manual_record Mods

1

Help with getting int from config

1 emerald3 replies111 views
created 12/29/2013 3:12 pm by charlieepperly
last reply 12/29/2013 3:26 pm
Hey im kinda new to plugin making and i was trying to make a potion effect pull the time from the config but it dosn't work could someone please tell me what i'm doing wrong.
Here is the code:

public boolean onCommand(CommandSender sender, Command cmd, String commandLable, String[] args){
if(commandLable.equalsIgnoreCase("Potion")){
Player player = (Player) sender;
if(player.hasPermission("EasyPotions.Potion")){
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, plugin.getConfig().getInt("Time"), 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, plugin.getConfig().getInt("Time"), 1));
return true;


then the config is just
Time:1200
Posted by avatar
charlieepperly
Level 1 : New Warrior
3

3 replies

1
12/29/2013 3:20 pm
Level 51 : Grandmaster Programmer
MattsOnMc
avatar
I only have 1 suggestion try removing the "plugin."
1
12/29/2013 3:24 pm
Level 1 : New Warrior
charlieepperly
avatar
Omg you are a saver. Thank you so much!!
1
12/29/2013 3:26 pm
Level 51 : Grandmaster Programmer
MattsOnMc
avatar
np

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome