Jump to content

Mod won't zip & mcmod.info problems


TuxCraft

Recommended Posts

I recompiled and reobfuscated my mod and put it in the minecraft mod folder with forge installed and it works fine. But when I try and put it in the .zip format or .jar format it doesn't load in forge, it doesn't crash it just simply doesn't show up.

 

Also when I put an mcmod.info file in the non zipped version that works it says I still don't have a mcmod.info file, help!

Link to comment
Share on other sites

Could I have a copy of the zip/jar that fails?

 

Nothing personal but I've worked long and hard on my mod and I'm not sure I'm ready to just give it away to a total stranger on the internet. I will however tell you anything you'd like to know about the structure and files.

 

Also I know why the mcmod.info file didn't work, there was an error in the syntax.

Link to comment
Share on other sites

Could I have a copy of the zip/jar that fails?

 

Nothing personal but I've worked long and hard on my mod and I'm not sure I'm ready to just give it away to a total stranger on the internet. I will however tell you anything you'd like to know about the structure and files.

 

Also I know why the mcmod.info file didn't work, there was an error in the syntax.

Sorry, but I've worked long and hard on gaining my knowledge of Minecraft and I'm not sure I'm ready to just give it away to a total stranger on the Internet.

 

I'M NOT EVEN ASKING FOR THE SOURCE.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

I don't believe your a bad person I just simply don't know you so call me paranoid if you'd like, I just don't want to run the risk of putting my trust in the wrong person. If you know what's wrong or what might be wrong please answer, if not, or if you don't feel like helping serious developers move on.

 

Also a little more insight on my problem. When I run reobfuscate.sh instead of reobfuscate_srg.sh it still works in the normal folder format but when I zip it or jar it it crashes with some class not found error, however all the classes are there I double checked and triple checked. I'm on a mac, may that be my problem? Btw I have no base edits so that's why I used the _srg instead of the normal one.

Link to comment
Share on other sites

You've most likely got the mod files in a subfolder in the .zip file at a guess.

If you could give us some idea of the structure of the files in the zip (so much as a screenshot would be good) then we might be able to give some more help.

Link to comment
Share on other sites

You've most likely got the mod files in a subfolder in the .zip file at a guess.

If you could give us some idea of the structure of the files in the zip (so much as a screenshot would be good) then we might be able to give some more help.

 

This is how it is the minecraft mods folder.

 

b8928225amrwa.png

 

 

And here's the mcp folder screenshot, just in case you need that too.

 

8719b2e7eexu6.png

 

Link to comment
Share on other sites

I don't believe your a bad person I just simply don't know you so call me paranoid if you'd like, I just don't want to run the risk of putting my trust in the wrong person. If you know what's wrong or what might be wrong please answer, if not, or if you don't feel like helping serious developers move on.

 

You're going to have a hell of a time releasing it then.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

You're going to have a hell of a time releasing it then.

Exactly what I was thinking.

I don't believe your a bad person I just simply don't know you so call me paranoid if you'd like, I just don't want to run the risk of putting my trust in the wrong person. If you know what's wrong or what might be wrong please answer, if not, or if you don't feel like helping serious developers move on.

Y'know what? I could solve your problem by asking for the folder setup. You might misunderstand me. I might have to ask for other things. And it would be so much easier if you just gave me the jar. I don't even care about seeing the source!

 

If I were interested in stealing other people's mods, I would have to ask for the source. Otherwise I couldn't update it. I'm not afraid to do work, but I do it ON MY OWN MOD. And guess what? It's a universal thing among coders: I would probably look at your source, were you to show it to me, and gag. I had a problem, recently, with someone's config. I looked at their code, ran from the computer, and cried. I'm sure it works for them, but I hate reading anyone's code but my own. Not to mention that I would probably think your mod idea is stupid.

 

I never say this to people, of course. If I'm going to decide to help other modders, I may as well be nice about it. I try not to judge people. I'm not even judging your mod. But when people come here asking for help? They had better be prepared to help me help them. I'm an advocate of open-source; it says so in my profile. That doesn't mean I can't deal with closed-source; I'm a Minecraft modder after all. But, even among open-source coders (perhaps especially among open-source coders) there is an unwritten law: you do *not* steal others' code. You use it to help learn something, or to find out what's wrong with yours. But you do not take others' ideas. Nor do I want to. I have no interest in adding a spear to my mod, and, to be honest, it would take twice as much work to decompile yours and fit it to the rest of my mod than it would be to simply code one myself. Or perhaps you think I would just take your jar, touch up the license a bit, and then post it on the MC forums? Apart from the fact that it doesn't work, I might just as easily distribute IronChests and say it's mine. And I couldn't do anything with it either.

 

TL;DR: If you're asking for help and you're not prepared to show us what you're working with, DON'T EXPECT ANY.

 

Ugh, perhaps not a very well-written rant... but then I guess that few actually are.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

here's the thing, ObsequiousNewt is right. nobody can do anything without the source unless you really want to spend the time deobfuscating it, I had to for the mod that i took over development for. so asking for a copy of the offending folder is a small price to pay for getting an answer to your question. hell, pm him or me the folder, ill be glad to zip it up send it back. you just need to trust someone who's trying to help you.

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

Link to comment
Share on other sites

Not that anyone here steals source code either.  Borrow it to see how someone did something that they might be trying to figure out how to do (I recently looked up the source code to a backpack mod so that I didn't have to write the GUI code myself because I hate it, but I added functionality to it that was specific to my mod) but they aren't going to outright steal your mod.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Okay, what's the big deal? I try to protect my code from potential scumbags and you blow up in my face? What's wrong with wanting to keep your hard work safe? By the way you're responding you are truly leading me to believe you want my code for the wrong reasons, why else would you fight a budding young developer for what he believes is right? If you were in my situation would you trust some random guy on the internet, which by the way is the best place in the world to lie and get away with it, with your months of hard work? Now, you can make the argument that your code would be superior to mine because you have had more modding experience then I. Well I strongly disagree with that, just because the code might be better doesn't mean the content is, it doesn't mean the textures are worse, it doesn't mean the models are worse, my mod is a lot more than a simple spear. You have made the argument that you couldn't do anything without the source, I'm sorry to tell you but java decompilers do exist, do a quick search on google and you'll find them. If the computer can decompile, a program can too, the logic is that simple. For anything one piece of software can do, another can undo, that is one of the beauties, and dangers of computers. This isn't about, "It would take more work to incorporate your mod into mine" that is completely dependent on the situation and as I said before you are a complete stranger to me, I don't know you, I don't know your situation you could be anyone doing anything.  You said you can solve my problem with screenshots? Ask for them, do not ask for months of hard work that is vulnerable because it has not yet been released. Every part of that jar is an asset and some you wouldn't even need a decompiler to take and exploit.

 

I never attacked you or your open-source coder law so why are you defending yourself? You are taking this way to personally. I respect you and everyone who answers questions here on the forums even if they openly disagree with a mod and that won't change, you put up with a lot of noobs here and don't get thanked enough for what you do, but even so there are some things I will not give you when you try to help me. Because there are bad people out there and I don't want to run the risk of being a victim of any of there shenanigans. I will give you a few pieces and parts that I feel are causing me trouble, but I will not give you everything.

 

I have given you my screenshots in a previous post if you'd still like to answer my question.

Link to comment
Share on other sites

Okay, what's the big deal? I try to protect my code from potential scumbags and you blow up in my face? What's wrong with wanting to keep your hard work safe? By the way you're responding you are truly leading me to believe you want my code for the wrong reasons, why else would you fight a budding young developer for what he believes is right? If you were in my situation would you trust some random guy on the internet, which by the way is the best place in the world to lie and get away with it, with your months of hard work? Now, you can make the argument that your code would be superior to mine because you have had more modding experience then I. Well I strongly disagree with that, just because the code might be better doesn't mean the content is, it doesn't mean the textures are worse, it doesn't mean the models are worse, my mod is a lot more than a simple spear. You have made the argument that you couldn't do anything without the source, I'm sorry to tell you but java decompilers do exist, do a quick search on google and you'll find them. If the computer can decompile, a program can too, the logic is that simple. For anything one piece of software can do, another can undo, that is one of the beauties, and dangers of computers. This isn't about, "It would take more work to incorporate your mod into mine" that is completely dependent on the situation and as I said before you are a complete stranger to me, I don't know you, I don't know your situation you could be anyone doing anything.  You said you can solve my problem with screenshots? Ask for them, do not ask for months of hard work that is vulnerable because it has not yet been released. Every part of that jar is an asset and some you wouldn't even need a decompiler to take and exploit.

Speaking as one of the aforementioned scumbags, I would like to say that if you want help, you're going to have to trust those people that you're asking. If you want to deal with the Internet at all, YOU'LL HAVE TO TALK TO COMPLETE STRANGERS. I'm not trying to argue that my code is superior; I'm just saying that other developers' code, as a general rule, looks wrong. This does not only apply to me. You'd probably hate the way I wrote my code.

 

I do not have the time, patience, or dishonor to try to steal anyone's code. Perhaps there are some who do. They can download your mod and distribute it as theirs. They can use decompilers, like you say. But you'll have to take that risk, unless your mod is intended for your eyes only. By sealing us out from your code, you have sealed yourself in. You're trying to say, "Help me with this circuit board. Only I won't let you touch it, or even see it. I'll show you pictures of certain parts if you like." If that gets you help, it'll take umpteen times as long as if you let me glance at your jar and say, "This folder is in the wrong place." Oh, and you think I'm likely a "scumbag" because I'm trying to make a point? Let me give you a lesson, henceforth to be known as the First Law of Flame: The worst way to get someone on the Internet to agree with you is to argue with them. The only reason why I'm bothering right now? Honor, if it means anything to you, and because I'm annoyed with near-hypocrites, and additionally because I'm feeling in an argumentative mood right now. Oh, and because of the Second Law of Flame: To leave an argument on the Internet is to admit defeat.

I never attacked you or your open-source coder law so why are you defending yourself? You are taking this way to personally. I respect you and everyone who answers questions here on the forums even if they openly disagree with a mod and that won't change, you put up with a lot of noobs here and don't get thanked enough for what you do, but even so there are some things I will not give you when you try to help me. Because there are bad people out there and I don't want to run the risk of being a victim of any of there shenanigans. I will give you a few pieces and parts that I feel are causing me trouble, but I will not give you everything.

We live in a sad world, where intellectual property is such a huge issue. As an open-source coder, I believe in credit where it's due, I believe in sharing, and I believe in the potential of others to act the same way. This is a philosophy shared by many. Look at what is perhaps the second most popular open-source licence, the CC-BY-SA. It says in the title that you must attribute your code to where you got it. I don't like the fact that Minecraft is closed-source, but that's something you have to deal with. I can deal with the fact that it costs, what, 30 dollars now? Because it's a great game, and I think that Mojang deserves to be rewarded for their work. For me, credit is all I desire, and I believe that you deserve it too. I came here because I wanted to help make Minecraft better, and because it was a game I liked to play. (I don't play much any more.) And I do have to put up with a lot here. I commend you, for being able to speak grammatical English. That's one of the most annoying things here. (Not that it's necessarily their fault.) But I will help you as much as I would help anyone... and if you refuse my help because you're paranoid, then there's nothing I can do about that.

 

If you would like to check your mod jar against mine, you can find it here, and my Github is here—but be warned that that is the *last* energy I will expend on your problem.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

Well.

 

There went any remaining empathy I had for you.

 

You do have the right to protect your code, but some problems are unsolvable without being able to actually look at what's going on.

 

And for the record, we never once asked for your source code, we asked for your release zip.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

If I may ask for only one minor file..... Your base class file.....

it should not include any major information

 

and if it will make you feel better i can show you my base mod class

I took over Hunting Traps Mod and work on helping the forge community as much as I can. View my work here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1443756-1-7-2-1-6-4-1-5-2-1-4-7-hunting-traps-mod-v-0-4-0

Link to comment
Share on other sites

And for the record, we never once asked for your source code, we asked for your release zip.

 

^^ What he said.

If you don't want to share the release zip with us, I have no idea how you plan on releasing your mod. Even once you've got a working zip or jar, it's all of about 6 seconds for absolutely anyone to unzip that.

width=463 height=200

http://s13.postimg.org/z9mlly2av/siglogo.png[/img]

My mods (Links coming soon)

Cities | Roads | Remula | SilvaniaMod | MoreStats

Link to comment
Share on other sites

A little bit off-topic to enforce his paranoia: it is indeed possible to decompile Java classes back to Java code.

 

So if you don't want people to leak your source code, you'll have to do what Mojang does: obfuscate. But it still doesn't fully protect your source code, as you as a developer can see yourself. ;) So throw your paranoia into the corner. If somebody really wants your source code, they can get it...

Link to comment
Share on other sites

A little bit off-topic to enforce his paranoia: it is indeed possible to decompile Java classes back to Java code.

 

So if you don't want people to leak your source code, you'll have to do what Mojang does: obfuscate. But it still doesn't fully protect your source code, as you as a developer can see yourself. ;) So throw your paranoia into the corner. If somebody really wants your source code, they can get it...

We know it's possible. If you mod Minecraft, you're already doing it :P

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

After the release I'm perfectly fine with you looking at the jar, it's just pre-release when it's vulnerable. I don't have any copyrights or any lawyers so if you just took it pre-release no one would know or be able to fight it. Post-release yes there will be people who try to take it and redistribute it but at least then I'll have a page to prove that I am the original author. Also with numerous references to my name in the code it won't be hard to prove that I am the owner of the mod, and I will be able to take legal action against all who try and rip me off.

 

Look, I trust people on the internet to an extent. You made an analogy to a circuit board, that does not apply even remotely to this situation. First off if you were having troubles and you went onto the internet to see if you could get your problem solved it would much harder to give your questioner your circuit board. If you had a problem with a circuit board you would take it to someone who was knowledgeable about this kind of thing in your area, and if your smart you'll watch him as he fixes your problem to A find out what's wrong and how to fix it, and B make sure he doesn't steal it. After I send you or anyone my jar I have no way to know what you are doing with it, and that scares me. Sure I could go by word of mouth, but that simply isn't enough for me. And by the way ObsequiousNewt, don't fool yourself, you were the one who started this argument. You were the one who felt it was so important to uphold your "honor" after I politely declined to give you my mod. Read back, open your eyes, while I simply wanted to protect what was mine you wanted to turn this into a flame war. YOU started this, never forget. You are the CEO of Pentachoron Labs, it says so in your description. If you are planning to make any money I advise you strongly to not post all of your work on github before release. You're a complete idiot for posting all your code on github pre-release. It's not like it's hard to find either! I searched Pentachoron Labs on google and that link was the first that showed up. Not only that but you have the name in your signature. What if some scumbag who has been browsing the forums sees you and does a little research on your little Pentachoron Labs and steals all your source. I'm assuming if you're a CEO you're company plans to make money, I'm telling you right now that is the WORST business plan I have ever heard. Justify your actions, I dare you. Justify going after a small developer who doesn't want to be a victim of internet theft, I challenge you. Justify what moral cause you think you have in pursuing this argument. You talk about honor, what you have is not honor, it is pride.

 

Btw, I like the like the laws of flame.  :P

Link to comment
Share on other sites

Fuck didn't mean to press thankyou! was trying to get the quote button!!!

 

I searched Pentachoron Labs on google and that link was the first that showed up. Not only that but you have the name in your signature. What if some scumbag who has been browsing the forums sees you and does a little research on your little Pentachoron Labs and steals all your source. I'm assuming if you're a CEO you're company plans to make money, I'm telling you right now that is the WORST business plan I have ever heard.

 

If you (ThauxCraft) had any sense you would quickly realize that "Pentachron Labs" is not a serious business attempt, but a name for his dev-team. Also if you thought he was trying to make money from modding, or if you even thought that modding was a way to make any decent amount of money you are massively incorrect. Modding is allowed for by Mojang, but not the sale of mods, which would be an infringement of their copyrights (you can find all this on the Minecraft website).

 

Also lets assume that he is a corporate CEO trying to steal your code. Do you really think that he would a) try to do this through a SUPPORT forums, on which he has a superb track record for helping people out, and b) make all his projects opensource? Also why would a corporate giant like "Pentachoron labs" even waste their time on support forums when they could be working on their own code making it better so they get more people to downloads and ergo more money?

 

Your argument for not giving away your source is valid, it's your property to distribute, but refusing to give away a broken jar, then asking for advice on how to fix it is just stupid.

 

 

 

Who the Fuck put the thank you button next to the quote button!!

Link to comment
Share on other sites

Who the Fuck put the thank you button next to the quote button!!

 

I've almost done it half a dozen times myself.

 

As for copyrights:

You have an intrinsic copyright on everything you create.  It's automatic.

 

Under the Berne Convention, copyrights for creative works do not have to be asserted or declared, as they are automatically in force at creation: an author need not "register" or "apply for" a copyright in countries adhering to the Berne Convention. As soon as a work is "fixed", that is, written or recorded on some physical medium, its author is automatically entitled to all copyrights in the work, and to any derivative works unless and until the author explicitly disclaims them, or until the copyright expires.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Can I just say this? Everyone calm the heck down! Look, Newt is a really good guy, he wouldn't steal your code, second, you can't do anything without the source. Newt, Tux was just saying he wants a closed source mod and didn't want to give it away, he was accusing you of stealing, he just didn't want his source out, this thing has gotten WAAAY out of hand. To put this thread out of its misery, Tux, stick your unzipped folder in the zip, not the conents of the unzipped folder, the entire folder. And try that. If that doesn't work, you'll have to show us how you have it set up, (NOT YOUR SOURCE!), so we can see if you have too many folders or something.

Link to comment
Share on other sites

Can I just say this? Everyone calm the heck down! Look, Newt is a really good guy, he wouldn't steal your code, second, you can't do anything without the source. Newt, Tux was just saying he wants a closed source mod and didn't want to give it away, he was accusing you of stealing, he just didn't want his source out, this thing has gotten WAAAY out of hand. To put this thread out of its misery, Tux, stick your unzipped folder in the zip, not the conents of the unzipped folder, the entire folder. And try that. If that doesn't work, you'll have to show us how you have it set up, (NOT YOUR SOURCE!), so we can see if you have too many folders or something.

Agreed. This has gotten out of hand. I regret making a big deal of it myself; I should have just ignored him once he refused to give me his jar. I guess I wanted to make a point.

Fuck didn't mean to press thankyou! was trying to get the quote button!!!

 

I searched Pentachoron Labs on google and that link was the first that showed up. Not only that but you have the name in your signature. What if some scumbag who has been browsing the forums sees you and does a little research on your little Pentachoron Labs and steals all your source. I'm assuming if you're a CEO you're company plans to make money, I'm telling you right now that is the WORST business plan I have ever heard.

 

If you (ThauxCraft) had any sense you would quickly realize that "Pentachron Labs" is not a serious business attempt, but a name for his dev-team. Also if you thought he was trying to make money from modding, or if you even thought that modding was a way to make any decent amount of money you are massively incorrect. Modding is allowed for by Mojang, but not the sale of mods, which would be an infringement of their copyrights (you can find all this on the Minecraft website).

Too true. To be a "CEO" is even too much of a claim for me, seeing as I'm equal partners with AJ. We're not trying to make any money off any of our code. Heck, I'm only a teenager!

 

Now, I understand that TuxCraft is more worried about credit than he is about money. I have given my response to that.

Also lets assume that he is a corporate CEO trying to steal your code. Do you really think that he would a) try to do this through a SUPPORT forums, on which he has a superb track record for helping people out, and b) make all his projects opensource? Also why would a corporate giant like "Pentachoron labs" even waste their time on support forums when they could be working on their own code making it better so they get more people to downloads and ergo more money?

I'm a corporate giant! Whee! Business is fun!

My point all along. And maybe it's time to leave it at that. I hope you (TuxCraft) solve your problem!

 

I had been wondering why you thanked both of us... :D

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.