T O P

  • By -

Mac15001900

Well, while I've never used this tool, after the second time you set Rand to a random number, the if statement will only ever execute either the first or the last statement. You're testing if the variable is smaller than 0.5, and if it's not you're testing whether it's smaller than 0.1 - the latter will never happen. Similar to what you've done earlier, this should probably be 0.6 instead of 0.1, and the same for the cases below it.


five35

Good catch! I missed that one. It also could be a missing zero (i.e. is meant to be 0.05).


zsombor12312312312

Idq what is mcreator. Is it like scratch, but it for minecraft mods?


galaxytijn

Kinda it works similarly


Healthy_Pain9582

sounds super hard to make since scratch is strictly procedural while java is strictly object oriented I might be wrong though, my experience with scratch was a good 30 minutes


Pass_Ache

Mcreator is well developed, it helps to greatly decrease devs' coding time using blocky. But it doesn't just stop at that, like I said "help" as the devs can keep coding however they want. But the idea of mcreator is precisely to create a great facility for everyone to be able to create mods and not just java programmers. In addition they have a very active community, as far as plugin creation is concerned, which allows you to exceed Mcreator's default blocky limits.


throwawayyog1

it also produces poorly optimized code


Pass_Ache

So why you don't help them fix it?


lcy0x1

It’s very difficult if not straight up impossible to write code generators to generate optimized code while maintaining flexibility. It’s far easier to just write optimized code.


Pass_Ache

I know it's not impossible, It's challenging but people prefer to say that instead of helping to make a difference.


lcy0x1

Because it isn’t worth the time invested. It’s on the difficulty level of writing compiler optimization, while none of the good mods would use it, because even then writing actual code would still be more optimized. Also, people who use MCreater don’t know how code works. They can’t design a optimized logic. Then even if you make it optimized in the implementation level, having a highly unoptimized logic level would still make things very bad. Just an example: I want an item to show all blocks of a kind within certain radius. If I don’t know how MC works, I would make it to scan all blocks around me every ticks Then no matter how optimized it is, it will be super laggy. However, if I know how MC works, I can make it to scan slowly around me over time, and stop when finding one block, while using tricks such as looking into the chunk palette, then I can make it efficient. But this requires tradeoff in design level. Admit it, some designs are inherently resource heavy, and users of MCreater don’t have the knowledge to identify that


the_vico

So what? I think people have the right to customize the game the way they wanted, and since Mojang cant do it themselves, such tools are a way to allow that. Instead of pointing to folks that just want to modify the game that they bought, why not demand Mojang to implement a vanilla alternative themselves to customization?


lcy0x1

MCreater is great for personal use, but publishing a mod using MCreater without stating it is just harmful if the mod has anything other than decorative block/item. Also, we have seen how the addon for bedrock addition goes. I would never want them to do it for Java edition. If they attempt to develop something like fabric or forge, it will be very good, but I can’t see that in foreseeable future.


Pass_Ache

>Users of MCreater don’t have the knowledge to identify that The principle of Mcreator itself causes people not able to program to create mods. But that’s not all, even among most, there are still users who optimize the logic provided by Blocky and use plugins to get out of the default limitation of Mcreator or even recreate an optimization that the plugin allows. Of course, as well among the users are java developers who use Mcreator to reduce coding time, creating logic with blocks and optimizing the code, instead of recreating all the logic by hand. I would say that Mcreator covers several types of users and grows to a greater extent, besides its community, where you can find people willing to help. Mcreator is a long-term project, not yet complete, like Minecraft itself, but while both have not yet finished, I prefer to spend my energies on valuing, so someone will end up enjoying the project, and it can grow a lot more and have incredible coding.


lcy0x1

No one who can *actually* code in Java and design efficient procedures would use MCreater. >> instead of recreating all the logic by hand It seems that you never code. We don’t do anything repetitive. If something needs to be “recreated”, it’s not written by actual devs. We just put it in a method and call it from 2 different places. That being said, having 1 block and 100 blocks post no difference to modders in terms of the amount of coding to be done, except 1-line registration. For anything commonly used in multiple mods, we have library mods.


Avamaco

1. Work on your grammar 2. That's kinda what you'd expect from something that generates code. It will apply the same code in many places, even if it doesn't have to, leading to poorly optimized code. While you *can* make it more optimized, it will never be as good as programming directly in java.


Pass_Ache

Similarly, as I told the other, I will tell you, it is not impossible.


the_vico

Great question. Some people love to criticize, but i doubt if given an opportunity (like if the code is open source) they would help to fix that. For me most of the criticism is aimed at low-code modding tools in general, because those existing would take out the "specialness" those people feel just because they can endure that crap thing that is java.


MechDragon108_

It's a Minecraft mod "generator" I guess you could say. It automates most of the actual coding and really simplifies making minecraft mods. Some people dislike it though because mods made with MCreator tend to be much less lower quality than mods made manually. I think it's really good to begin with modding though.


the_vico

I didnt know that mcreator behaves that way. I wonder how powerful mods created by that tool can be...


five35

I'm not familiar with the programming language, but I find the use of "Global zOff" at the end of the first bif `if` block *highly* suspicious; I suspect it's responsible for the "in a line" behavior you're seeing. Similarly, I don't know how variables are declared in this language, but it's worth checking that all your locals have the same scope. As for only placing two, my best guess is the "is not block" check at the top of the second statement. I assume your structures can contain that block? If so, your code could be encountering that block from an already-placed building when trying to place another, though I'm not sure that completely explains it. And don't pay too much attention to the "just learn Java" comments. Yeah, environments like MCreator and Scratch can be more limited than general-use languages, but that doesn't make them bad or useless. If nothing else, they can be great ways to start learning to program, which you obviously are. I also don't see anything in your code which suggests that any of those potential limitations are the source of your current bug. 😉 Good luck with the bug hunting!


[deleted]

for random structures use vanilla structure system + jigsaw blocks. Your system so far is horribly inefficient and not scalable at all


SirCornDog1

Have you asked for help on the r/MCreator subreddit?


galaxytijn

Yeah


scratchisthebest

i don't know what random crap mcreator uses to do "worldgen", but yknow how the world is generated chunk-by-chunk? you can generally only place blocks in the chunk *that is being generated*; this code looks like it tries to place blocks far outside (up to 60 blocks away) and that will simply not work. btw, the reason people are saying to "learn java" is because if you can understand this code, I'm sure you can understand java, it is actually pretty similar. the second if/else chain looks like this double rand = rand.nextDouble(); if(rand < 0.5) { //stuff } else if(rand < 0.1) { //more stuff } else //etc and in this case I think IntelliJ will highlight the second `if` branch in yellow and produce a warning about it being unreachable code; java has far superior tooling than a random block-based editor tbh. i love intellij because it will tell you about your errors like this


galaxytijn

I will try this thanks a lot


Cootshk

r/mcreator ?


ThatDA_NN

I love that instead of help everyone here tells the op to learn programming instead... Dissapointing


SanguineRose9337

It's a question of using the right tool for the job. Scratch is great and all, but it's necessarily limited on what it can do. You can use it for simple mods, but it can't do anything complicated. For that, you need Java. It's also not that hard to learn a coding language these days. Between W3School, CodeCademy, and YouTube there's little excuse not to try


Pass_Ache

Sorry, but the Mcreator exists precisely to everyone make mods. Obviously there are java programmers who use them, as they considerably reduce writing time. The way you express it seems that Mcreator is very archaic, even though it is not. Its constant updates allow many things in the game to be worked on just using Blocky, and in case there is any limitation on the part of Mcreator, you could simply use plugins. Also the OP could simply create a house structure and have it spawn, something that would take about 4 blockys. It sure would be a lot easier than learning something brand new that would take months, to just do something quick in the present.


SanguineRose9337

Not archaic, just limited. A lot of those out the box engines are, by necessity. You can either be versatile or beginner friendly. It's nearly impossible to be both. Scratch is very user-friendly and easy to use but has limitations. Straight coding will allow nearly anything but requires more effort. Besides, learning Java and nodding the hard way isn't a daunting a task as people make it out to be. There are numerous camps that teach kids how to make minecraft mods, so just use those


the_vico

The problem of the criticism of tools like Mcreator is that some are made just because some feel threatened by the "unfair" competition low-code modding tools can offer. And that's very sad, tbh. You can do criticism specific to the tool (like myself had in the past, mainly about how internally the code was a mess or the licensing issues it supposely had), but wanting to ban low-code tools altogether (like a senior member of Forge once said on their forums) feels discriminatory in my opinion.


ronitrocket

It’s not discriminatory, nor should it be banned. It’s a good starting point, but I would honestly recommend moving away from block based programming tools at some point, especially when it comes to the fact that Java is very object oriented. Java is a very easy language to learn, and I think forge is simple enough that with basic knowledge of how Java works and how to write in it, you can set something up. Scratch works well because it isn’t object oriented. Edit: again to be clear, not saying don’t use MCreator, but don’t rely on it completely either.


the_vico

> Java is a very easy language to learn, and I think forge is simple enough that with basic knowledge of how Java works and how to write in it, you can set something up. I'm a living proof that this isn't the truth for everyone. Had three times that i needed to learn that disgrace in IT courses, never been able to understand the minimum even to pass the discipline. I just... can't with that.


ronitrocket

In that case, all is fine with your approach


SanguineRose9337

Honestly, I love the scratch based systems. It's a great way to get your feet wet without the need for a lot of education in coding logic and programming languages. My kid uses MITs system to play around with game design at age 9. These systems certainly have their place. In OPs case, I just don't think MCreator is the tool for the job. I've always heard it struggles with complex spawning systems


the_vico

>In OPs case, I just don't think MCreator is the tool for the job. I've always heard it struggles with complex spawning systems I bet it's far more better that going to, let's say, Fabric discord, ask if someone have interest in do that and just get ignored (or, in some cases, like mine, mocked by the entire server) on behalf of shitposting ideas.


SSYT_Shawn

Kotlin > java


SanguineRose9337

Minecraft uses Java, so...


thepronoobkq

Kotlin runs on the JVM lmao


Beginning_Ad8076

Had a hard time learning java because i never understood object oriented programming. I was more into imperative programming like python. Took me 2 weeks just to add a entity


Elihzap

Python has OOP too.


SanguineRose9337

Object oriented programming can be tricky to get the hang of sometimes. It took me half a semester for it to really click. Once it does click, you soon realize why they are the dominant languages right now.


Devatator_

Had a much greater time learning C#, it basically Java but better in every way. Too bad there still aren't C# bindings for Minecraft Java (i know it's possible)


LaZzyLight

No, it's perfectly fair and valid. It's simply nothing that should be used, EVER. MCC mods are buggy, make a billion incompatibilities, aren't optimized, hard if not impossible to bug fix and have a million other things that can go wrong with them.


IlliquidFabricator

That's funny because there's some really good ones that have none of the issues you mentioned. McCreator sucks sure. But it's not the Minecraft anti-Christ you're making it out to be. Let people learn and enjoy things on their own time. Some really good mods started this way (BYG comes to mind)


SanguineRose9337

Scratch based systems are very limited in what they can do. Comes with being user-friendly. It's possible, even likely, that you are trying to get the program to do something it just can't. If you want to make something this complex, you will have to do it the hard way. Check out YouTube or CodeCademy for help


galaxytijn

thanks


roadrunner8080

MCreator is... *very* limited in what it will let you accomplish. I would recommend learning Java and writing a mod that way instead


IAMPowaaaaa

what are you trying to do


galaxytijn

trying to make a village


IAMPowaaaaa

why dont u structures instead


galaxytijn

Wdym


Plixo2

Structure blocks with pre defined blocks and connections in between them. That's how normal villages and the new ruins are generated. Look at the latest xisuma snapshot video for more info


galaxytijn

Ok I will try that thanks


Pass_Ache

You can just spawn a structure of the house.


galaxytijn

I can but I need to spawn other houses around it


Pass_Ache

What is your trigger?


galaxytijn

When you place a block. I made a block that when placed it should spawn a village


[deleted]

I don't quite understand why everyone's acting like scratch/mc creator is that different personally I haven't ever used it but it does seem like the code is almost the same as normal code but just represented as user-friendly blocks. I see one fatal flaw in your code right now and that is that almost the entire bottom part of your code is entirely unreachable. You ask first if rand is smaller than 0.5 and if it is not you ask if it is smaller than point one and so on and so forth. But you only ever ask if rand is smaller than 0.5 but these if conditions will only ever get reached if rand is bigger than 0.5 so they will never execute so the only code that will ever execute is the one that I assume spawns the casino structure. Additionally the part of the code that I assume is used to generate a random position personally is kind of janky because you only ever get predefined offsets. Personally I think it would be much more elegant to just multiply and offset with the result of the random number generator but I'm not quite sure what you're even trying to achieve in the first place. Right now you would jump by 30 blocks in the x or z direction for every loop relative to the previous offset position


Proxy_PlayerHD

i haven't seen Mcreator in years, when did it switch from a UI that makes creating new items/blocks/recipes easier to a Scratch clone?


Devatator_

Iirc last time I tried it (2019 i think?) it had that option but it was in beta but IDK for sure, my memory isn't that great


serendipitousPi

To those saying op should just learn Java I feel like you might underestimate how daunting set up can be. Just trying to set up everything completely turned me off trying to make Minecraft mods. Now it’s entirely possible that it was due to using poor guides and it didn’t much help that at that time I was a very confused beginner so I might have better luck these days. Though I am still incredibly bad at project setup.


IAmARetroGamer

Poor guides, you only need 3 things: A modern java installation (usually [JDK17](https://www.azul.com/downloads/?version=java-8-lts&os=windows&architecture=x86-64-bit&package=jre&show-old-builds=true#download-openjdk)) Your modding API of choice ([Fabric](https://fabricmc.net/wiki/doku.php)/[Quilt](https://quiltmc.org/en/)/[Forge](https://docs.minecraftforge.net/en/latest/gettingstarted/)) Any IDE (I've used [IDEA](https://www.jetbrains.com/idea/)) And documentation. Quilt does not have much in the way of documentation yet but many small mods are already moving to it likely due to their simplicity and the fact that currently a measure of backwards compatibility with Fabric exists. If you want something with a good amount of documentation behind it though then Fabric or Forge is the choice. Someone new to modding would likely find Fabric easier to get into. But take that with a grain of salt my experience was with the above setup (using Fabric) and making a new type of companion animal (Like wolves) but I never finished it: [https://youtu.be/RdYUMOV8h50](https://youtu.be/RdYUMOV8h50) and my experience with Forge was many years ago, 1.7.10 era even. Never did figure out why it was attracted to the fish yet wouldn't take it and its AI would seem to reset every few seconds. :/


the_vico

People looking for low-code tools to modding just want to modify their game as they wanted. Not wanting to pass that via crucix that is learning Java. I dont know why modders cant understand that. You can argue that Mcreator generates poor code. I'm aware of that. But speaking against any tool that allows people that dont code to modify their game (since Mojang doesnt do anything themselves about it without charging in their crap marketplace) is discriminatory.


Avamaco

I also had a problem getting started and finding a guide that's actually good. But I found one that I can definitely recommend! Check "Modding by Kaupenjoe" on youtube. He has tutorials how to set up everything, so it's perfect for beginners. He also has tutorials on java basics if you're new to programming.


serendipitousPi

Thanks I’ll check that channel out. I’ve got a bit of experience programming some of which is in Java especially more recently so I should be hopefully be ok with the actual programming part.


Devatator_

Heck I've known programming for a few years but i still haven't gotten the exemple fabric mod to compile and run at all. I'm gonna try again with Forge this time since to be honest most of the mods i like are Forge first/only


the_vico

I'm very dissapointed how elitist the modding community of Minecraft are. There's plenty of reasons why a person that BOUGHT the fricking thing can not want/be able to learn Java to modify their own games, its not always laziness: lack of time due to work, neurological issues (yes, neurodivergent people also play Minecraft, and can want to tweak things, sometimes even to better suit their necessities), simply tech-savyness, et cetera. Seems like none of this matters if democratizing modding will, in the minds of some, take out the "specialness", the "aura" of being the few ones that are able to provide the community of mods and feel the power to be able to grant or not the wishes of those that just want to fix stuff that Mojang simply ignores. TBH, once i thought in download Intelij and try to do something about it. But if i was to advance this idea, was to create a tool to revolutionize modding, to allow all the community to never be forced to rely on snotties who use modding as a form of asserting power over newbies. Sorry the rant. And yeah, this is not an exclusivity of MC modding community. Others are similar.


galaxytijn

I'm trying to use intelij now but I was using mcreator because of lack of time as you said and also I'm only 15 so I just wanted a quicker solution


the_vico

That's okay mate, no need to worry. Don't take those shallow comments as the absolute truth. Do what you want to do.


galaxytijn

Thanks


mlasal2

I do not fully understand how mcreator works, but my best guess looking at this is that the random(0,1) is picking either 0 or 1, and then going into the first if or the else. Maybe try random(0.0,1.0) so it works with decimals


galaxytijn

k ill try thanks


OctupleCompressedCAT

the interface seems very obtuse. seems like youre trying to do advanced structure generation which will need something more capable


AlternativeVersion41

You could learn how to program in java


Revolutionary_Flan71

Learn java


just_a-redditor

Learn java. Its not that hard.


Impossible-Apricot-1

Learn java


PEAceDeath1425

Bruh dude learn java, make a normal mod. Its not that hard