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

Solved Random Chest Refilling

Comments in 'Plugin Development' started by Legoboy0215, Jul 6, 2015.

  1. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    I am making a random chest refill plugin and I have no idea how to generate random items. I want to restrict the random items to weapons, from swords to bows. Yes, almost like RandomItem by @LDX but for chests. What should I do?
  2. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    Read the RandomItem source
  3. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    I did...
  4. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I made this plugin a while ago, if I find the code, I will let you know.

    (I don't mean ChestRefill, I made another private one for randomized refilling.)
    Andrey Nazarchuk likes this.
  5. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Thanks! Maybe PM me? Cuz they do not allow posting plugins in the threads.
  6. iJoshuaHD
    Offline

    iJoshuaHD Notable Member Plugin Developer

    Joined:
    Nov 7, 2013
    Posts:
    1,201
    Plugins:
    4
    Minecraft User:
    iJoshuaHD
    Who told you that? a lot of people posting plugins so ya xD
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Just don't make it sound like a release.
    iJoshuaHD likes this.
  8. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Mr. PEMapModder told us on a thread..
    PEMapModder likes this.
  9. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    @Falk If you found it can I please have it also?
  10. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    Item::get(rand(0, 255), 0, 1)
  11. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    lol. I finished that days ago.
  12. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    So change title to solved
    Legoboy0215 likes this.
  13. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Lol. No need.. These people are bumping this thread.
    jojoe77777 likes this.
  14. Andrey Nazarchuk
    Offline

    Andrey Nazarchuk Active Member

    Joined:
    Dec 30, 2013
    Posts:
    332
    Minecraft User:
    digita1eclipse
    Did you find it?
  15. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Sorry, I haven't, I don't know what I did with it. I probably made it and then deleted it for some reason, stupid me.
  16. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    981
    Plugins:
    9
    I can make one, but I want to ask @Falk first.
  17. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    Please, feel free. And if you find anything useful in the ChestRefill repo, you are welcome to use it without encumbrance from the MIT license.
    Andrey Nazarchuk likes this.
  18. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    Isn't it something like this
    PHP:
    foreach($this->getServer()->getLevelByName("survival")->getTiles() as $tiles){
        if(
    $tiles instanceof Chest){
            
    //Blah...
        
    }
    }
    Andrey Nazarchuk likes this.
  19. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    981
    Plugins:
    9
    Thanks! It will be finished in about a week! :D
    Yes, but I'll add some more magic! :D
    Last edited: Sep 15, 2015
  20. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,747
    Minecraft User:
    Legoboy0215
    I have magic, I have magic...
    Andrey Nazarchuk likes this.

Share This Page

Advertisement