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

    Creeoer

    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.
    Code:
    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

    fireblast709

    Creeoer replace them with an empty String
     
    SleepyDog likes this.
  3. Offline

    FisheyLP

    string.replace("this gets removed", "");
     
Thread Status:
Not open for further replies.

Share This Page