all this simple plugin needs to do is fill all the chests in the current world you are in with random items set in the config file. I would also like there to be a number associated with each item, which you can set, in the config which tells it with what frequency to add those items to the chests. I feel dumb for asking and would appreciate any help! Thanks in advance!
Its not infinite. Its an HG map so it has borders, also i don't necessarily need them filled at the same time instantly, it can be within like 30 seconds- 1 minute in which they are filled.
? what ? This is an HG map i didn't build so i don't know where all the chests are and there are a lot of them so it would take days to find and fill them all and i would miss some.
Are you asking for code or a plugin? If you are asking for a plugin you should post in Plugin Request
if you want to reset the chest at a certain Level , try this: PHP: public function refill(Level $level){// function that refill all chests in the world level , must be an instanceof Level$tiles = $level->getTiles(); //to get all tilesforeach ($tiles as $tile){ //foreach tile in the worldif($tile instanceof Chest){ // if the tile is a chestfor($i = 0;$i < 5;$i++){$inv = $tile->getInventory(); //the chest inventory$items = array( //The array that you can edit for the ItemsItem::get(276, 0, 1),Item::get(267, 0, 1),Item::get(364, 0, 4));$rnd = mt_rand(0, count($items) - 1); // the random index$item = $items[$rnd]; //the item that is random , i know that i can use array_rand() but it is my idea xD$inv->setItem($i, $item); // to add the random item} }}} if you have a worldname and want to refill that try this -> PHP: $level = $this->getServer()->getLevelByName("WorldNameHere");// to get the instanceof Level by a worldname$this->refill($level);// to called the refill function that we have defined xD