Altar Crafting

Discussion in 'Plugin Requests' started by Flopfleee, Dec 19, 2022.

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


    Plugin category: MISC

    Minecraft version: 1.18.2

    Suggested name: AltarCrafting

    What I want: A plugin where you have an altar which can be made in the config using specific blocks and recipes encoded. For example in the config:
    Materials: DIAMOND;3|STICK;2
    Result: DIAMOND_SWORD;1


    For example, you would place the items at the corner pillars and then like some particles or a lightning strike would happen and then the resulting item will spawn in the middle.

    When I'd like it by: ASAP
    JanTuck likes this.
  2. Offline


    Are you still looking for a plugin like this? Let me know if you still need one, I’d be happy to create it.
  3. Offline



    Yes please that would be amazing. Essentially place items in the 4 corners. If the items match a recipe which will be set in the config. Some particle animations will occur and it would take some time. The time for the recipe to complete would also be set in the config. The resulting item will appear in the middle pedestal. To place the items in the 4 corners. You would right click the block and it would take the item from the inventory and drop it onto the pedestal. You can set the despawn time to infinite and set it to be unpickable. That's what I did to get the item to appear but if you have another way, feel free. To retrieve the item in the pedestal, you would left click the block and it would put the items back into the inventory. To start the craft (once the items are in the corners and its a valid recipe) you right click the middle pedestal and some particles will occur. I want the particles to like start at each of the corners and then diverge into the middle pedestal. After the craft has completed, the items will be gone from the 4 pedestals and the resulting item will appear in the middle pedestal and you could pick it up by once again left clicking the block. Also, to prevent other players from stealing items from the pedestals or interrupting the craft, once a player starts placing items in, the altar should be locked to just them and until they complete the craft, no other player can place or pick up items.

    Attached Files:

  4. Offline


    I'd also be interesting in doing this for you one of these days, it seems cool. I haven't played minecraft in a while, do you want the altarblocks to be able to be specified in the config?
  5. Offline


    Yes please, that would be amazing thank you
  6. Offline


    I could do something like this aswell, unless @JanTuck beats me to it :p
    I will start working on it a bit later today, I want to finish something else first
    Last edited: Feb 3, 2023
  7. Offline


    That's fine, thank you.
  8. Offline


    Question: Unless you want the recipe-ingredients limited to a maximum amount of 4, there will be no check for which corner the ingredients are being put on. So if a recipe has 5 ingredients, you can all put them on the same corner block and it will still work fine.
    Is this ok for you or would you prefer the option of such checks, but therefore limiting the ingredient amount to a maxmimum of 4?

    EDIT: I can just do both actually, providing the option to enable checks but automatically ignoring it if the ingredient amount is larger than 4. Nevermind :)
  9. Offline


    Is it possible to have both a 4 option crafting and a 9 option crafting. Also I would prefer to have all the items be on separate corners with no specific order. So you can only have 1 type of an item at a time. That would be great and thank you.

    Also would it be possible to as well as use vanilla items in the craft, also have MMOItem items since that's the main rpg item plugin we use so we can have both vanilla items and mmoitems. That would be amazing thanks.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Feb 6, 2023
  10. Offline


    Yes, both of those things should probaby be possible. I am having issues working with the MMOItems API currently, as the imports are not working as expected. I have contacted their discord support, I will have to wait for their response on that, but I can keep working on other plugin functions meanwhile.
  11. Offline


    Alright, that’s perfect thanks
  12. Offline


    Question: How exactly do you want the 9 ingredients recipe to work? Should the middle block be used to place an ingredient aswell in that case? Didn't even think about that yesterday when reading the post lol
  13. Offline


    Instead of the 9 recipe one. Could we have an 8 item one. I wanted it to be a separate altar. So instead of the normal 4 corners. This altar will have 8. Like the image. The middle block will remain the output yh. Same functions as the 4 corner altar just more corners lol. So both a 4 corner altar and a 8 corner altar would be amazing thanks.

  14. Offline


    Would it be ok to keep the general rectangle shape of the altar? Or I would remove the ability of resizing the altar, at least for that instance of altar-type. I am not sure if you even need that feature anyways, I don‘t see you specifically saying that anywhere, I had just thought of including it
    If you want me to implement specific shapes (in different sizes and arrangements of block-types) like this, that you want to use, that would probably be a lot easier to implement anyways, so I‘m fine with that too

    Just let me know what kind of configurability is important to you and what isn’t basically, so I specifically know what exactly to implement and in what way. I probably should’ve asked that in the first place anyways actually
  15. Offline


    Sounds like a cool idea. If it can't be made by raffel, I have some ideas on how to setup the checks and operations of the plugin that I could probably get around to coding.
  16. Offline


    could we have the altars locked to those specific shape and size. So exactly like the 8 corner altar image I sent and the 4 corner altar. The block type for the altar would be the configurable option. Also in terms in overall configuration:
    For each recipe in the config, we can set a time which will be the time of the delay between the item crafted. So for example you place all the items in the corners and then right click the middle block to start the craft, It wouldn’t immediately consume the items and give the product but the items would sit there for however long was specified in the config for that recipe and some cool particles will occur also. I want the particles to like start at each corner and then converge towards the centre like an arc if that’s possible. Once a player starts the crafts and the particles and stuff is going on. They should not be able to take the items back out during the craft.

    When a player starts placing items into the corners, only that player can now place and pickup items and use the altar. Once he’s picked up all remaining items, then any other player can use it. This is to prevent other players from stealing items and interrupting the craft.

    Also can you make it so only people with OP can make the altars. Cheers

    That’s all I can think off for now for configuration. I’ll let you know if I need anything else. Tysm

    If you want to give this a go, I don’t mind at all. Thats fine thanks.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited: Feb 8, 2023
    raffel080108 likes this.
  17. Offline


    I never said anything like „I can‘t do it“..? I am simply asking him for specifics so I can make sure I do it right for him. And I do mind, because just bcs I am not like the fastest at making it (since I don‘t have that much time every day) I am still dedicating to this project, and doing so not that someone else just finishes it themselves, just because they have more time to do it or can code a bit faster or whatever.
    I am in fact already done with implementing checks for the altar structure, so nothing to worry about there - I had to actually put some thought into it, but it‘s pretty straightforward actually

    Everything you said should be fairly straightforward to implement. I had already incorporated a permission that restricts the actual creation of altars.
  18. Offline

    timtower Administrator Administrator Moderator

    He never said he would start right away either.
    mehboss likes this.
  19. Offline


    I was commenting on this in saying that I do mind about it and would prefer if he would just let me finish the project instead of starting/doing it himself
    timtower likes this.
  20. Offline


    What exactly does that question have to do with the fact that you haven't played minecraft in a while? Also, I had hoped that I had made it clear that I am working on this project and have already deticated a lot of work to it (I am almost finished already) and that I would prefer it if nobody else would interfer with that, in terms of starting/attempting/doing this project themselves - Thanks :)
  21. Offline


    I never said I was going to start coding the plugin. I also never said that you are slow at coding or incapable of doing it. I had implied that if for WHATEVER reason it can not be done by you, I would be more than happy to do it. Carry on :)
    raffel080108 likes this.
  22. Offline


    Ok, I'm done!
    I've attached the finished version of the plugin.
    The only thing I had to cut down on a little bit is the particles - They don't converge from the corners to the middle, but rather just form a solid line instead. I really tried to figure something out, but that was the best I could come up with, sorry

    Please make sure to tell me any bugs/issues or things you want changed/added, I'm sure I missed at least a couple of things during my testing

    Sorry that it took that long by the way, as I said before I don't have that much time to spend on coding every day, but I try to do my best :)

    EDIT: I kinda forgot I should maybe explain the functionality a bit:
    To create an altar, type /createaltar <altarName> (permission altarCrafting.createAltar) (this will provide auto complete for all available altar-configurationss) then click (right-click or left-click doesn't matter, both works) the center block of the altar you want to create
    For an existing altar, you can right-click one of the corner blocks to put the item into the altar for crafting, aswell as right-clicking already placed items to retrieve them - All features such as crafting-sesssions (only 1 player can use the altar while items are on it) and automatic timeout (configurable in the config) are included. The plugin will check if the player has inventory space and if not so drop items right-clicked in the altar at that location instead.
    Once you placed all ingredients, right-click the center block of the altar. If the recipe was valid, either, if no craft-delay is set, a lightning strike will hit or an anvil sound will play (depending on what is set in the config) and the result item will spawn on the center block
    If there is a craft delay, a sequence will begin where particles are in a line from all placed items and the center block, while a metallic sound repeatedly plays. Once the timeout is over, the same as above will happen (lightning-strike or sound and then item will spawn on the center block)

    You can cancel a player crafting-session using /cancelAltarCrafting <playerName> (if you only type the command with no player name or your own name, you can cancel your own crafting session - this does not require a permission, otherwise permission altarCrafting.cancelAltarCrafting applies (for cancelling other player's crafting sessions))

    You can reload the configuration using /altarCrafting reload (permission altarCrafting.reload)

    Please note, that if a plugin such as worldguard cancels an interaction event with a block or entity for the player, the plugin will (intentionally) not process that event, so things like creating an altar or placing/retrieving items will not work for that player in that case

    EDIT 2: Something I forgot to say - I have included support for MMOItems, as requested, but since I will not buy a premium plugin simply to test such an implementation I am unable to test it. Please make sure to test the implementation and tell me if it works (or rather if it doesn't work, I guess :p)

    (removed outdated version attachment, please refer to a later post on this thread or the SpigotMC page for an updated version)
    Last edited: Feb 13, 2023
  23. Offline


    This is amazing thank you. I have one question about the MMOItems feature. I think i'm doing it correct but the recipe is invalid. How do I fix this?

    EDIT: I figured out you can't set an item amount. Is it possible to tweak this to allow item amounts for MMOItems also. That would be perfect thanks.

    EDIT 2: Also I discovered that when using any altar. You only need 1 item out of the recipe for it to be valid. For example in the config, the example recipe is 2 sticks and 3 diamonds for a diamond sword. You can just place in 2 sticks and start the craft and it will work. Also I found out when I was trying to complete an 8 item craft. It wouldn't work. It would say invalid recipe however I tried it with like 3 out of the 8 items and it worked. And each time I tried it, it changed. For instance sometimes I would place 7 items and it wouldn't work and if I placed 3 items it would work. It's really buggy.

    This was the config for it.

    Last edited: Feb 13, 2023
  24. Offline


    Oh, yes - I see my mistake. I am simply getting the MetaData for the MMOItems item, I forgot, that that of course does not include the amount required for the recipe. Give me a hot minute to fix that :)

    EDIT: Updated version attached - I litereally had to add 1 line of code :p
    Please tell me if it works for you now

    (removed outdated version attachment, please refer to a later post on this thread or the SpigotMC page for an updated version)
    Last edited: Feb 13, 2023
  25. Offline


    The item amount now works for mmoitems. Perfect thanks. However the other problems still exist mentioned in my other post.
    raffel080108 likes this.
  26. Offline


    Thought I had fixed that, weird - I'll look into it

    EDIT: Fixed - I apparently had messed up the check when fixing something else and forgot to test it again at the end. It was pretty late at night when I finished it yesterday :p
    Sorry about that
    Updated version attached

    EDIT 2: Whoopsie, I forgot to remove the debug messages - Ignore that please xD (Attachment updated)

    (removed outdated version attachment, please refer to a later post on this thread or the SpigotMC page for an updated version)
    Last edited: Feb 13, 2023
  27. Offline


    That fixed it, amazing thank you. Although there is one more issue...
    When trying my eight item recipe it doesn't work and says Invalid Recipe.
    I do not know what the problem is and why it is saying it detects a dupe item when none of them are dupe items.

    EDIT: When I remove all the other items from the craft, it works just fine. It's only when all 8 items are together which is strange.
  28. Offline


    The recipe parser checks for duplicate material-types, if any of those items have the same material it won't work, as identical items will cause issues to happen. I forgot to check for NBT aswell - Since it doesn't matter if an item has the same material if the nbt data is unique, that is obviously not a duplicate item. Give me a minute to change that, sorry
    Last edited: Feb 13, 2023
  29. Offline


    Oops I'm so sorry, I forgot to mention this earlier. Is it possible to have an option in the config for permissions for recipes. For example, a specific recipe I want to be locked behind a certain permission. If you don't have it, it would return the message "You have not unlocked this recipe yet!" Thanks.
  30. Offline


    Sure, will implement that together with the bugfix I am currently finalizing

    EDIT: Done - Updated version attached. The recipe parser now checks for exact matching NBT-Data, not just item-material. I implemented your request, together with a customizable no-permission message. So in the same place where you set the permission in the recipe, you can also set the message displayed to a player who attempts to use the recipe without the permission. (Refer to the comments in the configuration for exact details)

    EDIT 2: I wanted to inform you that I have uploaded this resource to SpigotMC and GitHub by the way, hope thats ok with you :)

    Attached Files:

    Last edited: Feb 13, 2023
    mehboss and Flopfleee like this.
Thread Status:
Not open for further replies.

Share This Page