Solved Scrap sort of system

Discussion in 'Plugin Development' started by Declan5486, Oct 8, 2015.

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

    Declan5486

    If you know what Minecraft Murder is (playmcm.net) there is a random scrap spawning method i am wondering how this works it spawns Iron Ingots randomly throughout the map and when a player collects 10 of them it runs some code and removes the 10 scraps anyway i could get a example of this ?
     
  2. @Declan5486 Spawning easy. Every so often drop an itemstack. Check if a player picks one up, if they have 10 run some code and remove them.
     
  3. Offline

    Declan5486

    Could i have an example please ? i havent done dropping itemstacks in my past but i do need a scrambalise system
     
  4. Offline

    Zombie_Striker

    @Declan5486
    Code:
    World.dropItem(Location,Itemstack);
    
    // the OnItemPickupEvent
    int amount of scraps = 0;
    for(Itemstacks itemstacks = player'sInventory.getContents){
    if(Itemstack == Material.STUFF)
    amount of scraps += Itemstack.getAmount();
    }
    if(amount >= max){
    player.removeall(Stuff)
    player.addItems(Items)
    }
     
  5. Offline

    teej107

    @Zombie_Striker I think Inventory has a method to check a number of certain items.
     
  6. Offline

    Scimiguy

    It also has methods that the OP can check and learn, rather than copying-and-pasting some code someone made for them
     
Thread Status:
Not open for further replies.

Share This Page