1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[Question] How to create a Chest Tile

Discussion in 'Development' started by InspectorGadget, Mar 21, 2017.

Thread Status:
Not open for further replies.
  1. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Hi! This deserves a Facepalm section but how do I create a Chest Tile?

    Thanks :p
     
  2. [deleted]

    [deleted] Guest

    You mean how to spawn a Chest and how to get the Inventory after it?
     
  3. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Yes
     
  4. [deleted]

    [deleted] Guest

    Damn I could do it in 2 days....
    U have to spawn a chest with $level->setBlock () function. Then I would use $level->getTile ()
    In 2 Days I will send Code examples, on Friday.
     
  5. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    The problem i've is idk where to start :p
     
  6. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    What do you mean on Chest Title ? Add a chest inventory window to the player's screen ?
     
  7. InspectorGadget

    InspectorGadget Zombie Pigman

    Messages:
    462
    GitHub:
    InspectorGadget
    Yes and getting the items in it
     
  8. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    Have you looked at this code in pocketmine\block\Chest?
     
    SOFe likes this.
  9. moska

    moska Baby Zombie

    Messages:
    105
    GitHub:
    supermaxalex
    You can check right now the plugin called "ChestShop" created and developed by Muqsit ! (All credits are coming to him)
    -> https://github.com/Muqsit/ChestShop
    It completes everything what you want.
     
    Muqsit and [deleted] like this.
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    :facepalm: If you don't have anything constructive to say, just don't post, OK? You are just repeating the question. Nobody cares if you can get the code by Friday or not until you actually show something.
     
    OnTheVerge and Muqsit like this.
  11. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    That's not true though. $level->setBlock() never creates a tile. You have to create the NBT and other data for the tile, then create it along with the block. My source is in my above reply, if you need proof.
     
  12. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Deleted all the nonsense in this thread.
    Please note that the Plugin Development is for discussion on plugin development, not code copying. This is not a place where "gimme the code for this" and "lemme send you the code for it". This is a place for discussing how things should be done, why things should and should not be done and what something in the API is for. If you are just looking for code or only want to write code, please go to the Plugin Requests forum.
     
    EdwardHamHam and corytortoise like this.
  13. [deleted]

    [deleted] Guest

    Then you should delete your Post...
     
  14. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Truth or not, nobody cares about whatever you promise. Please don't fill the whole thread with something that isn't constructive to future readers.
    This thread is asking about the creation of a chest tile, which obviously involves Level::getTile()/Level::addTile() (by common sense), and probably not related to setting a block.
     
    OnTheVerge likes this.
  15. [deleted]

    [deleted] Guest

    Again, first read then write. I also told him from $level->getTile ().
     
  16. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    First read, then write. The thread is about creating tiles, not getting existing ones. :facepalm:
     
    corytortoise likes this.
  17. [deleted]

    [deleted] Guest

    Stupid? I also told him how to create one. ;):facepalm:
     
  18. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    And where did you do that? o_O

    Level::setBlock() has absolutely nothing to do with creating tiles and Level::getTile() returns an existing tile. Saying you will provide code is nothing short of shitposting, just wait till you have the code ready to post instead of spamming the thread with useless garbage. :D
     
    OnTheVerge and Sandertv like this.
  19. [deleted]

    [deleted] Guest

    No its about getting ones please read the Thread hmm?
     
  20. [deleted]

    [deleted] Guest

    (;
    After Block is created you could check if its a tile.
     
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.