Magic

Magic

190k Downloads

Alohomora on iron doors - General questions .

Shilodabing opened this issue ยท 63 comments

commented

hello again nathan :)

I have a dude respect "Alohomora" , I tried to open iron doors with "Alohomora" but nothing happends, what can I do? or I do something bad?

commented

Nice! I have all except one more thing , the message when you buy a wand by the ticket, I'll try to translate:

ollivander:
    cast: You exchanged $requires for $item
    insufficient_resources: You must have $requires
    title: "Ollivander" 

but doesnt work :/

commented

No it's intentional that it doesn't work on iron doors- if you want to change that, add this to spells.yml

alohomora:
  parameters:
      destructible: doors

I should probably make it level up like its survival counterpart, which opens iron doors at level 2.

commented

oh! i will test, 2 question... how can i implement spells of others mode with the main potter? , something like this?

add_examples:

  • potter
  • beding

and.. how can i translate the type of wind? for example...
sin titulo

I dont find it in "messages.yml"

commented

Should look like this in config.yml:

add_examples:
- potter
- bending

Wandlore is in the potter configs, messages.yml, under "randomized":

https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/examples/potter/messages.yml#L569

commented

Make sure that's in the "spells" section of messages.yml, should work.

commented

I tryed again and ...
sin titulo

commented

You can add a "deducted" string in there to change the "You bought" text.

ollivander:
  deducted: "..."
commented

Nice! its works! , I tell you , I want to disabled the crafting of brooms with "enable_crafting: false" in config.yml , why? Because I want to sell them. So, how can I get the brooms? and , can I put them in a normal plugin shop?

commented

You can use a magic NPC with "broomshop" if you want.

Few shop plugins can handle magic items. Shopkeepers can, perhaps any plugin which lets you add items in-game will work (not dtlTraders). Essentials sign shops can do it due to Magic integration (use wand:broomstick on a sign... if it fits). But any shops that use config files are not likely to have a way to add items with custom data.

/mgive broomstick

Will give you one, if you want to test adding it to your own shops. I recommend using Magic's shops though.

/npc Brooms
/trait magic
/mtrait broomshop

commented

oh! I didn't know that , so.. I will use the Magic's shop of course :P , Is the same with the upgrade of wands?

I have a message with NPC "Spell broomshop unknown"

I used...

/npc create brooms
/ trait magic
/mtrait broomshop
commented

You can put "spellshop" on an NPC for that, buying spells is the normal way for wands to get upgraded.

You can make a shop that sells mana upgrades and such too but I've got nothing built in for that.

commented

If it's not too much trouble, can I ask how to do it?

commented

I tryed to find my error but I cant solve this.

I tryed to create a brooms shop or "/mgive broomstick" but i have the same message " "Spell broomshop unknown""

commented

Oh, I forgot, potter configs :D

Try adding this broomshop to spells.yml:

broomshop:
    icon: gold_spade
    category: npc
    hidden: true
    actions:
        cast:
        -  class: ItemShop
    parameters:
        quiet: true
        confirm: true
        confirm_filler: stained_glass:3
        items:
        - item: wand|firebolt
          cost: 10000
        - item: wand|nimbus
          cost: 5000
        - item: wand|comet290
          cost: 1000
        - item: wand|cleansweep1
          cost: 500
        - item: wand|bluebottle
          cost: 100

And refer to the wands in there for "/mgive" - potter configs have several different brooms.

commented

Nice ! Works perfectly , and... how can traslate the messages? , "costs 100 emerals" and "You bought 1 ..." , I tryed for the last "deducted" in "spells/brooms" in "messages.yml" but dont works .
And... how can I change the appearance of wands? I tryed to find the textures but is confuse to me. I can see a lot of wands , i want to modify wands of "example: potter"

commented

Here is the spellshop example which has most of the text customized:

spells:
    spellshop:
        name: Spell Shop
        title: "$path Spells ($balance)"
        description: Buy spells for your current level
        cost_lore: "Costs: $cost"
        no_items: There are no spells for you to buy here
        no_path: You may not learn with that $wand.
        no_upgrade: There is nothing more for you here.
        no_required_path: You must be at least $path!
        no_path_end: You must be ready to advance from $path!
        no_wand: You must be holding a wand!
        insufficient: "&4Costs &c$cost"
        confirm_title: "Buy $item"
        deducted: "&d&oYou bought &r&6$item &r&d&ofor &r&a$cost"
        fail: ""

That would go in messages.yml, under the name of your shop spell. Each shop can have its own different text, unfortunately this means you need to translate each one. I'll try and think of a better way to handle that.

To change textures, you unzip the RP, replace textures, then zip it back up. This is easy for potter wands because they are just textures and not 3D models. The potter wand textures are here:

https://github.com/elBukkit/MagicPlugin/tree/master/Magic/src/resource-pack/default/assets/minecraft/textures/items/flat

So just replace the png files in the "flat" folder.

commented

Oh! Ok, thank you so much, in the RP folder i can see a variety of wands, the wand by default (potter) is the "black" , can choose other wands like "skinny" or "wolf" if i rename the "black" wand ? or can I create "ollivanders" and buy 4 types of wands? (black, skinny, wolf ,brown and elder)

commented

Black, skinny and brown are the 3 used by default. Ollivander will give you a wand box, when you open the box it contains a random one of those 3. (The wand chooses you....)

If you want to make a shop instead and let players choose, you could do that but it would take a bit of work.

Another option is to make a separate shop where they can spend money to change the appearance of their wand.

The wolf wand is for me, you could replace the texture and give it out as a 4th wand appearance, the texture as-is is not very Harry Potter-ish. The elder wand is of course the icon for the elder wand, if I were you I'd leave that in as a special admin wand but that's up to you.

You can also add more texture, as many as you want, this is just a little more complicated.

commented

Dammit is true . The wand chooses me jajajaja , so... if I want the wolf wand Is difficult because the wand box is random... and how can I create a shop to select the appearance of wand? It's just curiosity

commented

Ha

You can make a shop like this:

appearanceshop:
    icon: wood_hoe
    inherit: buyshop
    parameters:
        auto_close: true
        confirm: true
        confirm_filler: stained_glass:3
        require_wand: true
        items:
        - item: wand|skinny_upgrade
          cost: 1000
        - item: wand|brown_upgrade
          cost: 1000
        - item: wand|black_upgrade
          cost: 1000

If you want more appearances, you have to add the upgrade items to your wands.yml. They are pretty simple, look like this:

black_upgrade:
    name: Black Wand Appearance
    upgrade: true
    icon: wood_hoe:25
    upgrade_icon: wood_hoe:25
commented

well. Thank you for the explanation, I will add new's texture wand's and continue with the magic lore.. "The wand choose you" to finish is just curiosity, why are you the only to can choose the wolf wand? :P

commented

You are welcome to use it, it's just personalized to me and crazy OP and dangerous :)

I have a todo item now to make shop text easier to translate, I'll let you know how that goes.

commented

The wand that should not be named .. jajajajajaj oh yes! if I can help you to the translate, you are welcome ^_^. Thank you much again nathan :P

commented

Ah! I have a 3d models of wands, I need to put this models on "flat" folder and add in the "spell.yml" this wand?

commented

If you have 3D models you want to replace the flat textures, drop them in the models folder instead:

https://github.com/elBukkit/MagicPlugin/tree/master/Magic/src/resource-pack/default/assets/minecraft/models/item/flat

If you just overwrite the ones that are there, it's easy. If you want to add new ones or give them different names, you also need to edit wooden_hoe.json

https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/resource-pack/default/assets/minecraft/models/item/wooden_hoe.json#L31

If you have some experience with resource packs, that would help - otherwise take a look at this tutorial:

https://www.spigotmc.org/wiki/custom-item-models-in-1-9-and-up/

commented

Ummm I tryed to add more wands BUT dont appear in the shop, (Works when I overwhite )

EDIT: No, appear but without the texture :S

commented

Ahrigumi,
Hello! My name is Droobledore, I figured I could offer some help in this situation! Sorry if I am chiming in here, but make sure you are updating your JSON for the item you are using. If you are using durability of a diamond hoe for example, you have to make sure you update the diamond_hoe.json file with the right information so your model will read.

As Nathan said, make sure you read and understand how to use models here!
https://www.spigotmc.org/wiki/custom-item-models-in-1-9-and-up/
That should help you get started!

commented

Hello doobledore! Yes! As nathan said, im looking the tutorial to update the RP , at the moment the only problem are the textures. I suppose it is for an error in json of wooden.hoe :P

commented

the Formula should be:

10/item durability

for the numbers it's here:

http://minecraft.gamepedia.com/Item_durability

so if if stone has 132 uses

the formula would be 10/132 = 0.0757575757575758

0.0757575757575758 is your first number

commented

I tryed but with wooden_sword , the code is 0.1666666666666667 , work but no the textures so...
i dont really know what im doing bad :S

commented

Ok the wooden_sword has different durability than stone hoe. the damage numbers aren't the same.

commented

Ok so make sure you check these things:

  1. you have the model JSON somewhere in your resource pack
  2. if you are using durability make sure that your wooden_hoe.json file has the correct durability numbers and the name of the model in there!
    example:
    {"predicate": {"damaged": 0, "damage": 0.01666666666667}, "model": "item/NAMEOFMODELHERE"}
    ]
  3. in the game, when you are making wands out of these items. the wands should be flagged as 'unbreakable: true' otherwise sometimes the model won't show.

good luck!

commented

I'am trying but don't know why dont appear the texture of wand, for example.
I use a stone_hoe.json , so.. i need to put:
"{"predicate": {"damaged": 0, "damage": 0.0075757575757576}, "model": "item/flat/stone_hoe"}," .
Works but i dont see the texture :/

commented

Do you know how to spawn the item in at 'that' durability? so for example:
/mgive stone_hoe:5

if the numbers of the "damage" is wrong, then it will not work.

commented

Ummmm Yes, I know the command, but I use "/mgive stone_hoe:0.0075757575757576 and I get a new stone hoe

commented

oh no, ok so it doesn't work like that. so the list will be 1,2,3,4,5,6.

commented

if you do the damage values in order, the first one will be stone_hoe:1. Second one will be 2, and so on.

commented

oh!, Yes, so... what should I expect with this?

commented

you should expect to see your model! :D

commented

nothing :( , from 1 to 130 , dont know what is happend, maybe the model is Outdated?

commented

Hrm, no even if the model doesn't work, it would just show black and purple block. I think this means your numbers are wrong for damage.

commented

what models are you using do you have pictures of the models?

commented

Now Im triying to put this model , is a wooden sword
sin titulo

commented

If I overwhrite an existing wand (as nathan said), like brown or skinny, works perfectly BUT If I add new's wand, the nightmare begins
2017-06-14_21 14 31
(Here I overwhrite skinny)

commented

yea it is because the damage number you are using the stone_hoe.json is incorrect, each item has different numbers so the wiki should help with that!

commented

For example.. in theory, if I will use a golden_hoe with 33 uses . I need to put in json 1/33 --> 0.0303030303 right???

commented

I tried this morning to add wands using the potter template, but without results, I give up :/

commented

Thank you @Droobledore for helping out here!

@Ahrigumi let me see if I can break it down...

Step 1: Add your new model to the resource pack. I suggest putting the model in models/item/custom/ folder, and the textures for it in textures/items/custom.

Step 2: Edit your model JSON, if needed- you may need to make the textures at the top point to textures/items/custom:

...
    "textures": {
        "particle": "items/custom/umbrella",
        "texture": "items/custom/umbrella"
    },
...

Step 3: Edit the file (from my RP) models/item/wooden_hoe.json, adding a new line in the second-to-last position:

...
    {"predicate": {"damaged": 0, "damage": 0.55}, "model": "item/bending/air_glider"},
    {"predicate": {"damaged": 0, "damage": 0.566666666666667}, "model": "item/bending/air_staff"},

    {"predicate": {"damaged": 0, "damage": 0.583333333333333}, "model": "item/custom/umbrella"},

    {"predicate": {"damaged": 1, "damage": 0}, "model": "item/wooden_hoe"}
  ]
}

The number 0.5833333 comes from 35/60. Your new item (the umbrella) has a damage value of 35, which needs to be converted to a ratio in the resource pack (worst idea Mojang ever had). Since the total durability for a wood hoe is 60, you need to put in 35/60 here, or 0.5833333.

Step 4: Zip up your new RP, and load it in your client.

Step 5: Test the changes on a wand, this should work in-game to do so:

/mgive potterwand
/wand configure icon wood_hoe:35

If it does not, or if it turns the item into a pink+black cube, something is wrong so let me know.

If something does go wrong, it's often useful to check your client log. In the Minecraft launcher, in the Settings tab, turn on "Open output log when the game starts". This will log information when the resource pack loads, maybe pointing out the problem.

Good luck, don't give up! :)

commented

I have this :P
sin titulo

commented

Thank you Nathan for your help , to @Droobledore too ^_^
I will test !

commented

it works! Thank you very much . I have a little question about permissions. I need to create on permissions file 7 ranks for the 7 years ? or I create 1 rank for 7 years?
I do not know if I explain myself very well..

commented

You don't have to do any of that at all if you don't want to. Magic doesn't really use permissions like that, unless you really want to set it up.

I have added a better way to localize all of the shop text. You can now change all of these messages in "shops" and they will be used as the default text for all shops. You still need to translate any shop-specific text as you have been doing:

https://github.com/elBukkit/MagicPlugin/blob/master/Magic/src/main/resources/defaults/messages/shops.yml

Not all of that may apply to you, there are some weird shop options that don't really get used.

This is available in the latest dev build:

http://jenkins.elmakers.com/job/MagicPlugin/2168/com.elmakers.mine.bukkit.plugins$Magic/

Which I will probably release soon since I broke some stuff in 1.10 in the last release of 6.9.9

commented

I will gonna test the last build :P , (Thank you so much :) )

commented

Hello nathan! I have a little problem with broomshop , Before I could buy the brooms with emeralds, now I need $. but when I installed "economy" I have a message with "insufficient. What can I do?

(I have the last version 7.0.0)

commented

If you have a Vault-compatible economy plugin installed (like Essentials or iConomy, etc) then Magic shops will use that.

Emeralds are only used if you have no economy plugin.

If you want to use items instead you can add "use_items: true" to your shop configs.

commented

Well... I want to use Items or money to buy brooms, If I use "use_items:true" all shops would use items right?

commented

Oh, I understand right now, I had 2 economy plugins (Essentials and McMoney), they were in conflict :P

commented

Hello nathan! I have a little question, "Magic" has as economy default , Essencial eco? , I want to use iconomy but magic dont use this

commented

Magic has Vault integration. If you're using iConomy you probably need to make sure to turn off Essentials eco (in Essentials configs)

commented

Well... I will use Essencials , I think is better .

About the houses.. "Magic" has implemented "houses" ?

commented

No, Magic has nothing to do with /home or protection, it does integrate with a variety of protection plugins though (GriefPrevention, PreciousStones, WorldGuard, Factions, Towny, etc)

commented

Oh, I'm sorry, I didn't explain myself well.
I mean the points system about houses :P

commented

No, nothing like that in Magic, sorry.