LOL, ok I have a config file, and I am using this to get the data: PHP: $kitParams = $this->getConfig()->get('kits'); That works fine... BUT (see there is always a BUT), when I do PHP: $kitParams['pvp']['items'] ... it says this error which is... just.. annoying! Code: [NOTICE] ArrayOutOfBoundsException: "Undefined index: pvp" (E_NOTICE) in "/NPCKits/src/Samueljh1/NPCKits/main" at line 159 Here is an extract of the YML before you start judging anything! PHP: kits: #FORMAT '<slot>': '<id>,<data>,<amount>' pvp: kit-msg: "Kit 'PvP' Received!" #Msg To Run When a Kit is Given. x: '121' y: '72' z: '126' helmet: '298' chestplate: '303' leggings: '304' boots: '301' items: '1': 'id': 272 'amount': 1 '2': 'id': 260 'amount': 5 'COUNT': 2 #SET THIS TO THE AMOUNT OF ITEMS SET!!
It's logic. To use PHP: $kitParams['something']; You must get the config as array. To do this you first need to get the config array with this code: PHP: $kitParams = $this->getConfig()->getAll(); Like if I helped you
Yes. Printing the variable on console is the best thing to do. It helps you a lot! As @Falk said, do: PHP: var_dump($kitParams); Or: PHP: print_r($kitParams);
Read the YAML. It is logic. To use `pvp` inside `kit`, you should get `kit` first. He didn't do wrong. Apart from getAll() there is get() too.