Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to use...

Comments in 'Plugin Development' started by mamayadesu, Mar 14, 2015.

  1. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    How to use
    PHP:
    setContents()
    with chest and
    PHP:
    onSlotChange()
    with chest?
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    onSlotChange() is an internal function. You should not use it.

    Use addItem() to add items, and remove(), and setSlot().
  3. mamayadesu
    Offline

    mamayadesu Active Member Plugin Developer

    Joined:
    Sep 19, 2013
    Posts:
    146
    Plugins:
    4
    Minecraft User:
    mamayadesu
    How to get chest if event is PlayerInteractEvent (internal function onPlayerInteract())
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    PHP:
    use pocketmine\tile\Chest;

    $chest $event->getBlock()->getLevel()->getTile($event->getBlock());
    if(
    $chest instanceof Chest){
      
    // execute logic here
    }

Share This Page

Advertisement