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

certain slot

Comments in 'Plugin Development' started by Barrington, Nov 1, 2015.

  1. Barrington
    Offline

    Barrington New Member

    Joined:
    Jul 31, 2015
    Posts:
    41
    Minecraft User:
    Berrington
    how to set up the object in a certain slot hotbar?
  2. zombie_Power
    Offline

    zombie_Power Active Member

    Joined:
    Sep 7, 2015
    Posts:
    239
    Minecraft User:
    Zombie_Power
    PHP:
    $event->getPlayer()->getInventory()->setHotbarSlotIndex(1Item::get($id$damage$amount)); // 1 represents which slot you want, in this case, it will the be first slot
    Last edited: Nov 1, 2015
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Please stop posting wrong solutions. Both parameters of setHotbarSlotIndex accept integers, not Item objects.

Share This Page

Advertisement