Jump to content

[1.13.2] how to create item


TheHex

Recommended Posts

I use something like that:

In Main Class

@Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents
{
    @SubscribeEvent
    public static void onItemsRegistry(final RegistryEvent.Register<Item> itemsRegistryEvent)
    {
    itemsRegistryEvent.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
    LOGGER.info("HELLO from Register ITEM");
    }
}

In ModItems Class

public class ModItems
{
    public static final List<Item> ITEMS = new ArrayList<>();

    public static final Item REDSTONEPASTE = new ItemBase("redstone_paste");
}

In ItemBase Class

public class ItemBase extends Item
{
    public ItemBase(String name)
    {
        super(new Item.Properties().group(ItemGroup.MISC));
        setRegistryName(Reference.MOD_ID, name);
        ModItems.ITEMS.add(this);
    }
}

In Resources/assets/(MOD_ID)/models/item/

{
  "parent": "item/generated",
  "textures": {
    "layer0": "(MOD_ID):items/redstone_paste"
  }
}

 

Link to comment
Share on other sites

1 hour ago, DcZipPL said:

ItemBase

1. Stop using ItemBase.

 

1 hour ago, DcZipPL said:

public static final Item REDSTONEPASTE = new ItemBase("redstone_paste");

2. Stop using static initializers. Also, you only need to store one reference to your item (you are currently storing it in the itemList and as a variable).

 

1 hour ago, DcZipPL said:

public static final List<Item> ITEMS = new ArrayList<>();

3. Specify the type when constructing the ArrayList.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

On 3/2/2019 at 4:26 PM, DavidM said:

3. Specify the type when constructing the ArrayList.

You don't have to with Java 8+.

 

@DcZipPL don't provide copy/paste code like that. He doesn't learn anything from it and it's actually wrong in multiple places.

@TheHex create your Items in a RegistryEvent.Register<Item> event handler instead of a static initializer.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

On 3/2/2019 at 8:08 AM, TheHex said:

help

This post in no way allows us to help you. This is a forum, not a chat room.

 

In order to help you, you need to provide all of the information necessary. In this case, that means, you code pasted as text, not an image.

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

13 minutes ago, sunsigne said:

this video is still a good start

Umm, no.

I remember seeing this guy asking around here WHILE he was making this tutorial...

(Read as: "He was making the tutorial WHILE he learned the material, not after he had already learned it")

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

So what ? We learn everyday. And you can't pretend you already know how forge 1.13 works while it just pop out.

 

Not everybody need to be a pro to learn how to cook pasta. And if i don't know how to cook pasta i'm happy to find a tutorial of someone which show me how to cook pasta while he is unable to cook a pizza because it's too complicated for him. 

Edited by sunsigne
Link to comment
Share on other sites

If you make a tutorial while you are still making basic mistakes you inevitably pass these mistakes down to those who follow your tutorial, often resulting in Cargo Cult Programming.

  • Like 1

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

If you feel like writing code that

- is 3 times longer than the neccesary amount

- stops Forge from being able to dynamically reload mods at runtime

- can cause unexplainable crashes

- breaks well made mods that do everything right

- is 5 years out of date

- is not neccesary anymore

among many other things, feel free. But don’t expect not to get critisised for it, especially on these forums. And don’t go and create a tutorial (a tutorial is supposed to teach the best way of doing things) with your bad code, as it will create more mods and modders with the same problems and limitations. Forge 1.13 has been out for more than half a year, and parts of it have been out for almost 2 years. This rewrite has been going on for a long time, there are people who are defiantly familiar with it and know how it works.

  • Like 1

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

19 hours ago, sunsigne said:

As lons as it works

No. That is not a fair judgement to make.

Optimizations, data structures and algorithms exist for a reason.

 

19 hours ago, sunsigne said:

2nd time on this forum a person talk me about cult as argument after 2 comments.

"Cargo cult proogramming" is one phrase; you are misinterpreting the meaning of it.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

On 3/7/2019 at 2:22 PM, sunsigne said:

2nd time on this forum a person talk me about cult as argument after 2 comments. Don'ty take prommaming that seriously guys

https://en.m.wikipedia.org/wiki/Cargo_cult_programming

Doing things because someone else said "just do this, it works for me!" is not how programming works. 

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

On 3/8/2019 at 12:11 AM, Cadiboo said:

If you feel like writing code that

- is 3 times longer than the neccesary amount

- stops Forge from being able to dynamically reload mods at runtime

- can cause unexplainable crashes

- breaks well made mods that do everything right

- is 5 years out of date

- is not neccesary anymore

among many other things, feel free. But don’t expect not to get critisised for it, especially on these forums. And don’t go and create a tutorial (a tutorial is supposed to teach the best way of doing things) with your bad code, as it will create more mods and modders with the same problems and limitations. Forge 1.13 has been out for more than half a year, and parts of it have been out for almost 2 years. This rewrite has been going on for a long time, there are people who are defiantly familiar with it and know how it works.

 

Yes. But for the moment there are really few tutorial videos for modding in 1.13 if you think you can do better videos (what is surely true, i don't doubt about that), well .. just do it instead of whimpering because it doesn't exist !

 

I'm not telling you can't give argue why this video is bad, the very part i can't agree is you tends to say this video shoudn't be "allowed" to exist. But fact is without this video, a lot of people just couldn't create basic mods in 1.13 today. As this video doesn't concern you (because it's made by a beginner, for begginers), you can give your opinion but you can't say it's not a good start. Because actually, it's the only start we currently have (pedagogically, it's a lot more difficult to learn by reading alone than being explained orally buy someone, that's why we have teachers).

 

 

 

On 3/8/2019 at 2:19 AM, DavidM said:

No. That is not a fair judgement to make.

Optimizations, data structures and algorithms exist for a reason.

 

"Cargo cult proogramming" is one phrase; you are misinterpreting the meaning of it.

 

It's not like programming a whole video game, it's just an item. I'm not sure the tutorial he made can occur any crash. If you find one, you win  the argue. His code IS obviously a big MESS (even me can see it, while i'm a beginner), but not falty.

You are probably true for the second part, i already read the link and I get the methaphor. I even understand your apprehension about those kind of thing because i read A LOT of times on this forum "don't use ItemBase, don't use IIventory, don't use (dramatic music) IHasModel", and when people have bad habbit, it's hard to disassemble it.

But we (begginers) aren't all lazy guys who want you to vomit good the good codes in the mouth (there are some, i saw that), some of us (me) try really hard to understand WHAT you do and WHY you do this :) but we still need a start point to begin. And without this video, some of us just don't have one (as I said, there are really few videos of modding on youtube)

 

 

On 3/8/2019 at 9:57 PM, Draco18s said:

https://en.m.wikipedia.org/wiki/Cargo_cult_programming

Doing things because someone else said "just do this, it works for me!" is not how programming works. 

 

As I tried to say. It might be a start point : you write first, then you try to understand why things are like that. It's not the best start for sure, but it's the fastest, and if you just need to implement 2 or 3 simple items in your favorite video game, you don't need to learn ALL the programming part first.

 

Didn't you ever wonder why multiplication is communitative ? why 3*5 == 5*3 ? While division isn't ( 3/2 != 2/3 ) You just do this naturally because people told you "just do this, it works for me!" while you NEVER wondered why. The main answer for multiplication is because simple numbers are 1 by 1 matrixes, but usually, matrixes aren't communitative at all ! Did you learn what was a matrix before "communitatives" numbers in a mutliplication like you might do everyday ? I don't think so.

 

Did you already made an real experiment by yourself to be SURE the earth is round or flat or aren't you just repeating what you've been told all along and judging other people which doesn't think like you ?

Why do you say "hello" to people ? Why do you double click on your mouse instead of clicking once ? Why do you use shoes instead of walking without it, are you a dermatolog yourself to be SURE it's better ? Why do you vaccine ? Why do you cook meat isn't of eating i raw ?

 

There are A LOOOOOOOT of things we do without wondering WHY we do them. Because you are a doctor doesn't mean you are allowed judge people dumb because they don't know why they vaccinate, while you do know why. All of them don't want to become doctor either and DON'T NEED to spend weeks and weeks to understand why they need to do it, even sick people. You can't refuse vaccinating someone which refuse to know/learn/undertstand why they should do it. Maybe this person is a baker and he will refuse tommorow to sell to you his fresh bread because you don't want to know how to correcly cook it (i'm not talking about me, i don't refuse to learn code, it's an exemple)

 

Edited by sunsigne
Link to comment
Share on other sites

You are comparing learning programming and the conventions of a framework that can be done for free if you just devote some time, to studies that are funded by major corporations.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

Spoiler

Logs (Most issues require logs to diagnose):

Spoiler

Please post logs using one of the following sites (Thank you Lumber Wizard for the list):

https://gist.github.com/100MB Requires member (Free)

https://pastebin.com/: 512KB as guest, 10MB as Pro ($$$)

https://hastebin.com/: 400KB

Do NOT use sites like Mediafire, Dropbox, OneDrive, Google Drive, or a site that has a countdown before offering downloads.

 

What to provide:

...for Crashes and Runtime issues:

Minecraft 1.14.4 and newer:

Post debug.log

Older versions:

Please update...

 

...for Installer Issues:

Post your installer log, found in the same place you ran the installer

This log will be called either installer.log or named the same as the installer but with .log on the end

Note for Windows users:

Windows hides file extensions by default so the installer may appear without the .jar extension then when the .log is added the log will appear with the .jar extension

 

Where to get it:

Mojang Launcher: When using the Mojang launcher debug.log is found in .minecraft\logs.

 

Curse/Overwolf: If you are using the Curse Launcher, their configurations break Forge's log settings, fortunately there is an easier workaround than I originally thought, this works even with Curse's installation of the Minecraft launcher as long as it is not launched THROUGH Twitch:

Spoiler
  1. Make sure you have the correct version of Forge installed (some packs are heavily dependent on one specific build of Forge)
  2. Make a launcher profile targeting this version of Forge.
  3. Set the launcher profile's GameDir property to the pack's instance folder (not the instances folder, the folder that has the pack's name on it).
  4. Now launch the pack through that profile and follow the "Mojang Launcher" instructions above.

Video:

Spoiler

 

 

 

or alternately, 

 

Fallback ("No logs are generated"):

If you don't see logs generated in the usual place, provide the launcher_log.txt from .minecraft

 

Server Not Starting:

Spoiler

If your server does not start or a command window appears and immediately goes away, run the jar manually and provide the output.

 

Reporting Illegal/Inappropriate Adfocus Ads:

Spoiler

Get a screenshot of the URL bar or copy/paste the whole URL into a thread on the General Discussion board with a description of the Ad.

Lex will need the Ad ID contained in that URL to report it to Adfocus' support team.

 

Posting your mod as a GitHub Repo:

Spoiler

When you have an issue with your mod the most helpful thing you can do when asking for help is to provide your code to those helping you. The most convenient way to do this is via GitHub or another source control hub.

When setting up a GitHub Repo it might seem easy to just upload everything, however this method has the potential for mistakes that could lead to trouble later on, it is recommended to use a Git client or to get comfortable with the Git command line. The following instructions will use the Git Command Line and as such they assume you already have it installed and that you have created a repository.

 

  1. Open a command prompt (CMD, Powershell, Terminal, etc).
  2. Navigate to the folder you extracted Forge’s MDK to (the one that had all the licenses in).
  3. Run the following commands:
    1. git init
    2. git remote add origin [Your Repository's URL]
      • In the case of GitHub it should look like: https://GitHub.com/[Your Username]/[Repo Name].git
    3. git fetch
    4. git checkout --track origin/master
    5. git stage *
    6. git commit -m "[Your commit message]"
    7. git push
  4. Navigate to GitHub and you should now see most of the files.
    • note that it is intentional that some are not synced with GitHub and this is done with the (hidden) .gitignore file that Forge’s MDK has provided (hence the strictness on which folder git init is run from)
  5. Now you can share your GitHub link with those who you are asking for help.

[Workaround line, please ignore]

 

Link to comment
Share on other sites

26 minutes ago, sunsigne said:

Yes. But for the moment there are really few tutorial videos for modding in 1.13 if you think you can do better videos (what is surely true, i don't doubt about that), well .. just do it instead of whimpering because it doesn't exist !

Forge for 1.13 isn't even out of beta yet. Hold your horses.

 

26 minutes ago, sunsigne said:

(because it's made by a beginner, for begginers)

"And this video is for the blind about how to lead the blind."

 

26 minutes ago, sunsigne said:

matrixes aren't communitative at all ! 

And now your post is impossible to read.

 

And oh yeah. Octonion aren't associative or commutative. Sedenions are even weirder.

 

Your point is?

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

 

5 hours ago, sunsigne said:

shoudn't be "allowed" to exist

It teaches the wrong thing, and therefore, is misleading. The author should think twice before uploading a video as such.

 

5 hours ago, sunsigne said:

The main answer for multiplication is because simple numbers are 1 by 1 matrixes,

No... You are very ill-informed on how mathematics, number theory, and linear algebra works. False cause.

 

5 hours ago, sunsigne said:

"just do this, it works for me!" while you NEVER wondered why

Of course I wondered why.

 

5 hours ago, sunsigne said:

Did you already made an real experiment by yourself to be SURE the earth is round or flat or aren't you just repeating what you've been told all along and judging other people which doesn't think like you ?

Simple physics. Learn about gravity. You can easily prove it yourself.

 

5 hours ago, sunsigne said:

And without this video, some of us just don't have one (as I said, there are really few videos of modding on youtube)

Why do you have to start with videos? There are plenty of good text-based tutorials.

 

5 hours ago, sunsigne said:

and if you just need to implement 2 or 3 simple items in your favorite video game, you don't need to learn ALL the programming part first.

Modding is programming. If you cannot program, you cannot make a mod. So either learning to program properly or don't make a mod.

Edited by DavidM

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

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.