elBukkit / MagicPlugin

A Bukkit plugin for spells, wands and other magic
http://mine.elmakers.com
MIT License
242 stars 148 forks source link

Lore & potions effect (help) #86

Closed Blamo27 closed 8 years ago

Blamo27 commented 8 years ago

Hello I need some help for 2 things :

Firslty, It seems I can't name a magic item with special color codes : for instance, I would like to create a wizzard helmet with a special name, which would appear in green and bold. How can I do that ? And if it is possible, is it also possible to sell a normal item in a NPC shop (let's say, an emerald), but that emerald would be renamed in bold and green ?

Also, I want to put a potion effect on a wand, but I can't set it to power 1 : it's always minimum power II (strength II, etc). If I try putting "night_vision:1", it will be 2. If I try putting "night_vision:2", it will be 3 : it's always one number above what I write, thus making it impossible to put an effect power 1 (even with decimals).

NathanWolf commented 8 years ago

You can use "&" for color codes in place of the special Mojang character. This should work in-game and in configs.

You can use the /mitem command to create a custom item in-game, then save it and add it to a shop.

See: https://github.com/elBukkit/MagicPlugin/wiki/CustomItems

Minecraft potion effect powers start at 0, try "night_vision:0".

Blamo27 commented 8 years ago

For Minecraft potion effect, I tried: "night_vision:0" and it's still power 2.

Blamo27 commented 8 years ago

And "&" doesn't work : http://i.imgur.com/yXQuTWW.png http://i.imgur.com/Q3PGOxy.png

Error: http://i.imgur.com/FDsWg5m.png

NathanWolf commented 8 years ago

The item key itself can't change, unless you create it as a custom item. It should look like this if you want to keep it contained in the shop:

- item: bed
  cost: 100
  name: "&c&lBed"

Alternately, look at the custom items wiki link I posted above- you can create your custom item and save it and then put it in the shop, like...

/mgive bed
/mitem name &c&lBed
/mitem add lore An awesome bed!
/mitem save custombed

.. and then put "custombed" in the shop as the item. Maybe not worth it for something as simple as a rename.

I don't know what exactly you're customizing, but for most potion effects the config would look like this:

boon:
    parameters:
        effect_night_vision: 0

Tested this just now, it works fine, gives me the level 1 version.

Blamo27 commented 8 years ago

Okey thanks you c: But the effect doesn't work :/

Blamo27 commented 8 years ago

http://i.imgur.com/f8OfXMi.png

NathanWolf commented 8 years ago

It worked for me (though imgur is not, so you'll have to take my word for it)

Make sure to put "passive: true" on any magic item you want to work while worn. Otherwise effects are only granted when held.

Blamo27 commented 8 years ago

Doesn't work, it's still power 1 with this :

mageboots: passive: true icon: iron_boots indestructible: true locked: true keep: true xp_max_boost: 0.2 potion_effects: fast_digging:0 enchantments: protection_fall: 5 protection_fire: 4 depth_strider: 3

NathanWolf commented 8 years ago

What do you mean? It should be power 1 with :0

This is what I get, is it not what you're getting? Power 1

Blamo27 commented 8 years ago

:( conf

NathanWolf commented 8 years ago

Can you try this in-game?

/wand configure potion_effects fast_digging:0

That's what I did, I didn't actually do it via configs but it should be identical.

Blamo27 commented 8 years ago

It works, but the item seems to change back to power II promptly : https://streamable.com/8al2

NathanWolf commented 8 years ago

That seems very odd, it routes through the same code. I'll try out your configs when I get a chance.

Blamo27 commented 8 years ago

Our server is on 1.8 Thanks you for your time

NathanWolf commented 8 years ago

What version of Magic have you got?

Blamo27 commented 8 years ago

5.5.3

Blamo27 commented 8 years ago

@NathanWolf Fix ? :)

NathanWolf commented 8 years ago

I don't have a 1.8 test server anymore, this is going to take me a little while sorry. It's working in the latest build of Magic.

Blamo27 commented 8 years ago

You can test it in my server If you want, test server for plugins

NathanWolf commented 8 years ago

Thanks for the offer, but I have to set up a local one for debugging. I just don't work on the 1.8 build much anymore, but I will get to this when I can!

Blamo27 commented 8 years ago

Yes no problem I'm not upgrading my server to 1.9 because a lot of players hate this version.

Blamo27 commented 8 years ago

I'm creating a plugins and I want to know if it's possible to add mana to an item / wand after an event ?

NathanWolf commented 8 years ago

You can control wand mana via the API, yes:

https://github.com/elBukkit/MagicAPI/blob/master/src/main/java/com/elmakers/mine/bukkit/api/wand/Wand.java#L104

Blamo27 commented 8 years ago

With itemstack ?

NathanWolf commented 8 years ago

No- if you're trying to change the wand a player is holding, best to use Mage.getActiveWand, this returns a Wand instance directly.

Blamo27 commented 8 years ago

Ok I'll try, thanks for all !

NathanWolf commented 8 years ago

Ok, I was wrong! This was broken in the current 1.9 build as well. It's now fixed in both places- please update:

http://jenkins.elmakers.com/job/MagicPlugin-1.8/30/com.elmakers.mine.bukkit.plugins$Magic/artifact/com.elmakers.mine.bukkit.plugins/Magic/5.5.6-SNAPSHOT/Magic-5.5.6-SNAPSHOT.jar

dumptruckman commented 8 years ago

@Blamo27 if your player's don't like 1.9 because of the swing timer, they added a gamerule in 1.9.2 to disable that.

NathanWolf commented 8 years ago

A gamerule? They did? Why U no tell me these things? :D

dumptruckman commented 8 years ago

Uhhh... Maybe I'm just imagining things... I can't find it anymore D:

NathanWolf commented 8 years ago

You tease!

Well in theory you could make a plugin to give all players increased attack speed to compensate.

IDK, personally I could never imagine holding up a server update based on player complaints. You've just got to stay up to date ... there's really no two ways about it. Exploits, plugins, etc ...

Blamo27 commented 8 years ago

Some plugins are not up to date (1.9) :/

dumptruckman commented 8 years ago

You must be using some obscure plugins :(

Blamo27 commented 8 years ago

Elytra is so OP for PvP :/

Blamo27 commented 8 years ago

PvP/Faction servers

NathanWolf commented 8 years ago

Ha.. I'm sure you must have brooms, levitate, fling, blink and probably a zillion other spells disabled then. Players have a different opinion of what is "OP" when there's magic involved.