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

Custom enchants

Comments in 'Plugin Development' started by grpisawesome, Oct 4, 2015.

  1. AvivShopenCraft
    Offline

    AvivShopenCraft New Member

    Joined:
    Oct 14, 2015
    Posts:
    73
    Minecraft User:
    AvivShopen
    I made my custom enchants plugin, it has alot of enchants, basically i just get a normal sword and to add enchant i use /n then the enchant name + level, to check if the item contains the enchant, it first checks if theres /n in the name(you cant change the name of a item with /n using anvil, so players cant add enchants to the sword) and if it does have /n in the name, it removes the first line(the sword's name) and searches the enchant, eg: (/n is a downline)
    Item name: "Diamond sword/nOblieterate III/nRage VI/nInquisitive V"
    Then to check i use:
    PHP:
    If(count($lines explode("/n"$item->getCustomName())) > 0){
      Unset(
    $lines[0]); //$lines[0] = "Diamond sword"
      
    If(strpos("Obliterate"implode($lines"/n")){ //i might used strpos wrong
        
    $level $this->getCustomEnchantLevel($item"Obliterate"); //sorry i didnt have time to show you how you get the level
    //do stuff, in this case you want to use $player->knockback() because obliterate has a chance to knock your target far.
      
    }
    }
    And thats it:) sorry if i made mistakes i usually do that, fix me;)
    Last edited: Oct 28, 2016
  2. jasonwynn10
    Offline

    jasonwynn10 Active Member

    Joined:
    Dec 20, 2015
    Posts:
    87
    Minecraft User:
    jasonwynn10
  3. Blabla
    Offline

    Blabla Active Member

    Joined:
    Sep 19, 2015
    Posts:
    82
    Minecraft User:
    The_Beast_Inside
    It is actually \n for a new line, not /n :p
  4. SinlesFlyer376
    Offline

    SinlesFlyer376 New Member

    Joined:
    Sep 28, 2016
    Posts:
    4
    Minecraft User:
    SinlesFlyer376
    What about something like this

    Attached Files:

  5. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    Please consider using this forums http://forums.pmmp.io
    HimbeersaftLP likes this.
  6. SinlesFlyer376
    Offline

    SinlesFlyer376 New Member

    Joined:
    Sep 28, 2016
    Posts:
    4
    Minecraft User:
    SinlesFlyer376
    I just want to know how I could implement it only server
  7. SinlesFlyer376
    Offline

    SinlesFlyer376 New Member

    Joined:
    Sep 28, 2016
    Posts:
    4
    Minecraft User:
    SinlesFlyer376
    On my server
  8. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    Please if you refuse to make one over pmmp at the very least, dont hijack threads by others
    HimbeersaftLP and archie426 like this.
  9. SinlesFlyer376
    Offline

    SinlesFlyer376 New Member

    Joined:
    Sep 28, 2016
    Posts:
    4
    Minecraft User:
    SinlesFlyer376
    I'm not exactly sure how I hijacked it if I just asked a simple question ? About what the title says
    ...
  10. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    i am sorry but your chances of meaning full responses would be better if you just made a new thread with more details
    not saying you must but it is a good idea since it is another plugin need helping
    HimbeersaftLP likes this.
  11. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Yeah but you were the one who supplied an answer, even if it is a simple question, ASK IT ON THE FLIPPIN' NEW FORUMS
    SamGamgee55 and HimbeersaftLP like this.
  12. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
  13. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    Maybe now they might understand where is the new forum lol
    archie426 and HimbeersaftLP like this.
  14. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    It doesn't say it AT ALL on the forums homepage or something ridiculous like that...
  15. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    No no no no people should have freedom to ask wherever they wished
    BUT if they want more support they should seek the new one either way if they still chose this one, we should just let them be and welcome them to the deserted town
  16. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    amiremad likes this.
  17. Thunder33345
    Offline

    Thunder33345 Notable Member

    Joined:
    Apr 3, 2014
    Posts:
    755
    Minecraft User:
    Thunder33345
    HimbeersaftLP, archie426 and amiremad like this.
  18. archie426
    Offline

    archie426 Active Member

    Joined:
    Apr 26, 2015
    Posts:
    193
    Minecraft User:
    archie426
    Correction: 'Want support', I don't see why people need to get support on these forums
    HimbeersaftLP likes this.

Share This Page

Advertisement