Solved Remove characters from item name

Discussion in 'Plugin Development' started by Creeoer, Oct 29, 2014.

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


    Simple thing I'm trying to do (Well I hope) so I'm getting an item's displayname and checking if it contains "BB Block" then I want to remove those characters from the name, creating a new variable. How would I go upon doing this.
    ItemMeta im = player.getItemInHand().getItemMeta();
                    if(im.getDisplayName().contains("BB Block")){
                        String building = im.getDisplayName();
                        //String something = buildling.removecharacters("BB Block");
                          File file = new File(BB.getInstance().getDataFolder() + File.separator + "schematics" +File.separator+ something + File.separator +  ".schematic");
  2. Offline


    Creeoer replace them with an empty String
    SleepyDog likes this.
  3. string.replace("this gets removed", "");
Thread Status:
Not open for further replies.

Share This Page