Solved PlayerInteractEvent Help? Can't figure it out ;-;

Discussion in 'Plugin Development' started by Ecliipsed, Feb 26, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Ecliipsed

    Hey guys, im fairly new to Java coding and for my first plugin i want to code something for a server i own.

    When you left click a enchant table with an empty bottle it takes 10 exp from you and gives you an enchanting bottle (takes the bottle aswell). You have to have the perm ExpBottle.bottle to use this feature. If you do not have 10 exp than it does nothing. Could i get some help with this? I dont want you guys to do it for me but if someone could help walk me through this? <3 Much appreciated

    *UPDATED* [Fixed] [2/26/16]
    I have an error when trying to load it in:
    http://prntscr.com/a8h6hz
    Code:
    http://prntscr.com/a8h6qh
    Plugin.Yml:
    http://prntscr.com/a8h6wo
     
    Last edited: Feb 27, 2016
  2. Offline

    Swakiny

    Use PlayerInteractEvent, get action then check if the player is left clicking.
    Check if the player is clicking on a block, get block type then compare if it is a enchant table
    Check player xp, compare if its equals or higher than 10, give the player a enchanting bottle, remove 10 xp from player.
     
    Ecliipsed likes this.
  3. Offline

    Zombie_Striker

    @Ecliipsed
    You must have a firm understanding before jumping into bukkit. You will have a better understanding of what and how to do certain things if you have learned Java before working on bukkit. In case you have not learned Java yet, please find a tutorial from the following link, learn Java (should only take a week) and come back to bukkit.
    https://bukkit.org/threads/plugin-dev-sticky-learning-java-where-to-learn.395662/

    Post above explains how you would do it.
     
  4. Offline

    Ecliipsed

    Ok, ill mess around with it and see if i get somewhere. Ill keep you updated.
    Ill check that out :) I did minimal JavaCoding before, im just trying to jump start my brain and get back into it beacuse A. i need this plugin and B. I want to be able to code my own plugins and learn Java Coding

    @Zombie_Striker
    @Swakiny

    I have an error when trying to load it in:
    http://prntscr.com/a8h6hz
    Code:
    http://prntscr.com/a8h6qh
    Plugin.Yml:
    http://prntscr.com/a8h6wo

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 26, 2016
  5. Offline

    SkyleTyler1337

    @Ecliipsed The "main:" in your plugin.yml is incorrect. You need two i's.
    try
    Code:
    main: com.ecliipsed.warfineexp.Main
     
    Last edited: Feb 27, 2016
  6. Offline

    Swakiny

    "InvalidPluginException canno't find main class com.eclipsed.warfineexp.Main"

    Your main class is

    com.ecliipsed.warfineexp.Main
     
Thread Status:
Not open for further replies.

Share This Page