When I use link for button images, it takes forever to load unless i switch window and back to minecraft. I tried image path type but its giving black and purple image PHP: $form->addButton("Apple",0,$this->getPlugin()->getDataFolder()."images/apple.png"); and yes.. theres an apple.png in images in my plugin's folder
As far as I know, image path just can be used through a texture pack in your server. For example, if do you want to use the apple image, your code have to see like this (supposing that you are using the default texture pack): PHP: $form->addButton("Apple", 0, "textures/items/apple");
I couldn't find it, so I extracted it from the default texture pack. https://mega.nz/#!toNllKiL!9xMydcwTb6-39mgMP-HG7GLFbJAI-sj7O7SLpPfCiFE
I added it to resource packs folder. When I var dump resource stacks, it gives zero. PHP: var_dump(Server::getInstance()->getResourcePackManager()->getResourceStack()); PHP: #This configuration file controls global resources used on your PocketMine-MP server.#Choose whether players must use your chosen resource packs to join the server.#NOTE: This will do nothing if there are no resource packs in the stack below.force_resources: trueresource_stack: #Resource packs here are applied from bottom to top. This means that resources in higher packs will override those in lower packs. #Entries here must indicate the filename of the resource pack. #Example - vanilla.zip # - vanilla.zip #If you want to force clients to use vanilla resources, you must place a vanilla resource pack in your resources folder and add it to the stack here.
You don't need to put it. PocketMine already use the default resource pack of MCBE. Just use it as a reference for the path.
Download and extract that. Then, you'll have a folder named "textures". Inside the folder, you'll see all the textures. If do you want to go to the apple texture, just go to the "items" folder.
Remove "$this->getDataFolder() ." and the ".png" after "apple" Your code should look like this PHP: $form->addButton("Button", 0, "textures/items/apple");
I see it like this. If do you use your plugin folder ($this->getDataFolder()) you are using this path: "Texture Pack/Your plugin folder/textures/items/apple" (this path doesn't exists in your textures, that's why appears the black and purple imagen) Instead, without your plugin folder, you are using this path: "Texture Pack/textures/items/apple"
The "path" attribute is sent to the client directly. The client cannot access anything in your server's data folder.