Solved Place Event

Discussion in 'Spigot Plugin Development' started by 24763, May 22, 2016.

Thread Status:
Not open for further replies.
  1. Hello,
    I was wondering how it is possible to on block place, check the items name against the configuration file and obtain the other bits of data from there. The easy way to describe this is that i have a "kit-like" section in the config where server owners can define there own "kits". So i want to know how it would be possible to obtain the "kit. <name> .strings" while matching up the items name to the "kit. <name> .name" if that's understandable.

    So overall how can i match the name in the config and then also grab the string above it, if i need to redefine this just ask :p

    EDIT: Allowing me to obtain the name will help me towards my IF Statements to do certain actions if the block placed is equal to the name and block etc within my config.
  2. Yes i have this sorted, i now wish to check the blocks name and check within the configuration, and if it matches to find the string above (kit name) so i can do what i need.
  3. 10/10 explanation.
    Code (Text):
    if (event.getBlockPlaced().getType() == Material.getMaterial(String here))
    //^assuming you know how to get a string from the config.
    //Also assuming you know how to get the name.
    Edit: I think I missunderstood the question..

    Ps: im drunk.
  4. Yup you misunderstood, i know this bit easy.
  5. What do you need help with then
  6. Like the others said, did he answer your question? If not maybe explain a bit better?
  7. The user above asked about the event it's self which I know, I want to how how I can check the item the player had in there hand to it in the configuration file and then fetch the string above which should be the kit name.
Thread Status:
Not open for further replies.