How to remove a Block from the game

Discussion in 'Spigot Plugin Development' started by AsssassinJianer, Jul 6, 2018.

  1. Hey guys, i'm not entirely sure if i should be asking this here but here we go, so i'm working on a custom version of spigot based on 1.8.8 but with some modification to make it feel as close to 1.7.10 as possible, and right now i need to know how to remove certain blocks(suchs as the slime block and the variation of stone) from the game, thanks in advance
     
  2. I'm not sure if that's possible because the blocks that are available to the players are client side.
     
  3. dont allow crafting of the slime block, cheap way to fix the stone issue is on a chunk generate, replace all the stone variants with regular stone. best way would be to remove the block variant's blockpopulator from the overworld's chunkgenerator (not exactly sure how to start going about this but it shouldnt be that difficult) (unless its not a blockpopulator :O).
     
  4. It is indeed possible, i removed the code that handles the Enchanment Depth Strider and now it is no longer in the game
     
  5. You most likely just removed the ability to get Depth Strider from normal enchanting, rather than remove it from the game. Assuming that is so, you'd similarly just have to block the crafting recipe of a slime block and not make it a purchasable block. I don't see why you'd want to make your server like 1.7, though, you're missing out on quite a bit.

    EDIT://
    I believe a method like this in your onEnable would work for 1.8
    Code (Java):
    Iterator<Recipe> recipes = getServer().recipeIterator();
    Recipe recipe;
    while(recipes.hasNext()){
        if(recipes.next() != null &&
                (recipes.next()).getResult().getType() == Material.SLIME_BLOCK)
            recipes.remove();
    }
     
    #5 Escad, Jul 6, 2018
    Last edited: Jul 6, 2018