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

Wearable Block?

Comments in 'Plugin Development' started by JackboyPlay, Mar 6, 2016.

  1. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Is it possible to wear a block as a hat? When yes how?
  2. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Spawn a Block packet on top of the players head.
  3. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    Maybe that?
    PHP:
    $player->getInventory()->setHelmet(Block::get(101));
    // Stone?
  4. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    doesn't work :(
  5. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    I think the last 1 has to be 0 or null
  6. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    I said to send a Block packet. Learn more about packets and how to send them.
    I've never looked into sending block packets, so someone else will have to help you with that.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Level::sendBlocks()
    But that's terrible. Other players will just see a real block.
    I think what he is asking is like wearing a pumpkin.
    If you can, just wear the item like wearing a normal helmet.
    If you can't, there is no way you can.
  8. jojoe77777
    Offline

    jojoe77777 Notable Member Plugin Developer

    Joined:
    May 28, 2015
    Posts:
    653
    Plugins:
    1
    Minecraft User:
    jojoe77777
    A player can't actually "wear" a block in MCPE, but you can spawn a falling block on the player's head.
    applqpak likes this.
  9. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    You can only wear Pumpkins and hats.
    I started CustomHatPE, where you can use /hat to set the item in your hand as your hat. The items won't show up as "head block", but they are in the head slot.
  10. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    Yup, I tried modifying and adding isHelmet() to the block too and tried equipping myself with a block. The block would be worn (would be in the helmet slot) but the block wouldn't be shown!
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Even if the client accepts it, you should be using Item::get(), not Block::get(). You are setting helmet as a block item, not an item.
  12. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    I see another answer

    "//new Hat($this->$this->getAPI()), TODO: Implement when MCPE implements "Block-Hat rendering"
    ~ EssentialsPE
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It has no difference from what we have discussed above.
    thebigsmileXD likes this.
  14. JackboyPlay
    Offline

    JackboyPlay Active Member

    Joined:
    Apr 25, 2015
    Posts:
    507
    Minecraft User:
    JackboyPlay
    Okay can you send me an example?
  15. XFuryMCPE
    Offline

    XFuryMCPE Active Member Plugin Developer

    Joined:
    Jun 19, 2015
    Posts:
    137
    Plugins:
    2
    Minecraft User:
    XFuriousMC
    How though, lol

Share This Page

Advertisement