Can a Dev quickly help me with this please?

Status
This thread has been locked.

Liam Craven

Feedback score
0
Posts
224
Reactions
63
Resources
0
Just need to know what I've done wrong for this error to show up, new to learning Java and tried everything I could think of but its not working? help?
upload_2015-10-26_12-39-15.png
 

Attachments

  • upload_2015-10-26_12-39-15.png
    upload_2015-10-26_12-39-15.png
    201.1 KB · Views: 76
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Stephen

Irrelevant ☕️
Deactivated
Feedback score
8
Posts
2,326
Reactions
1,412
Resources
0
Try this
Code:
ItemStack enchant = new ItemStack(Material.DIAMOND_CHESTPLATE , 1);
enchant.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);


ItemStack enchant = new ItemStack(Material.DIAMOND_PICKAXE , 1);
enchant.addEnchantment(Enchantment.DIG_SPEED , 1);
 

Liam Craven

Feedback score
0
Posts
224
Reactions
63
Resources
0
Try this
Code:
ItemStack enchant = new ItemStack(Material.DIAMOND_CHESTPLATE , 1);
enchant.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);


ItemStack enchant = new ItemStack(Material.DIAMOND_PICKAXE , 1);
enchant.addEnchantment(Enchantment.DIG_SPEED , 1);
upload_2015-10-26_12-55-28.png
 

Attachments

  • upload_2015-10-26_12-55-28.png
    upload_2015-10-26_12-55-28.png
    210.7 KB · Views: 71

Liam Craven

Feedback score
0
Posts
224
Reactions
63
Resources
0
Extend the description of the problem, it seems as if it's going to say the method is ambiguous but I cannot read it.
You mean this?
upload_2015-10-26_13-26-28.png


(The quick fix doesn't work it just tells me to change it back to addEnchantment)
 

Attachments

  • upload_2015-10-26_13-26-28.png
    upload_2015-10-26_13-26-28.png
    332.6 KB · Views: 74

Liam Craven

Feedback score
0
Posts
224
Reactions
63
Resources
0
You can specify an Enchantment as a valid parameter for addUnsafeEnchantment.[DOUBLEPOST=1445866195,1445866151][/DOUBLEPOST]

You're importing the wrong Enchantment. You want to use Bukkit not NMS. Scroll up find import net. blah blah Enchantment and erase it out. Then import org.bukkit.Enchantment or whatever it is.
Thanks dude :) Works now :)
 
Status
This thread has been locked.
Top