Hello I am currently working on a plugin that makes TNT throwable, hereis the code: When I right click I get this error: Sorry if this is overwhelming but Im still trying to learn the ropes of basic plugin development.
Replace $player->chunk with $player->getLevel() Also $tnt->spawnToAll() is recommended instead of $tnt->spawnTo($player)
Also its recommended to get rid of number ids (46) replace it with ItemIds::TNT Just to help you in the future!
Also you may wan to remove 1 tnt from the current number if ita for survival server or factions so players will not have infinite tnt