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 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.
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.
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.
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.