I'm having some more troubles, this time with Ore Gen. Everything compiles, but my ore doesn't seem to be spawning in the world.
It might be related to predicates, but I'm not sure. I was prompted to choose from 4 versions of predicate, and com.google.common.base.Predicate was the only one that didn't cause Eclipse to throw a bunch of red lines at me. Was it the same one you used?
Yes I believe that is the right one. Try using higher spawn chance if you haven't already. If that doesn't work, would you be able to pm me your code so I can help you properly?
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
public class EnchantmentFirePower extends Enchantment
{
public EnchantmentFirePower() {
super(Rarity.VERY_RARE, EnumEnchantmentType.DIGGER,
new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND,EntityEquipmentSlot.OFFHAND});
this.setName("firePower");
}
/**
* Returns the minimal value of enchantability needed on the enchantment level passed.
*
* @param enchantmentLevel
*/
@Override
public int getMinEnchantability(int enchantmentLevel) {
return 15;
}
/**
* Returns the maximum value of enchantability needed on the enchantment level passed.
*
* @param enchantmentLevel
*/
@Override
public int getMaxEnchantability(int enchantmentLevel) {
return super.getMaxEnchantability(enchantmentLevel)+50;
}
/**
* Returns the maximum level that the enchantment can have.
*/
@Override
public int getMaxLevel() {
return 1;
}
/**
* Determines if the enchantment passed can be applied together with this enchantment.
*
* @param ench
*/
@Override
public boolean canApplyTogether(Enchantment ench) {
return super.canApplyTogether(ench) && ench.getRegistryType() !=
Enchantments.SILK_TOUCH.getRegistryType()
&& ench.getRegistryType() != Enchantments.FORTUNE.getRegistryType();
//can't apply with silkTouch and fortune together
}
}
public static Enchantment firePower;
public EnchantmentsLoader() {
try{
firePower=new EnchantmentFirePower();
GameRegistry.register(firePower);
}catch(Exception e)
{
e.printStackTrace();
}
}
but i don't know how to enchant it ( i don't is it registered succseful)
i find a method to add a enchant book named
Enchantment.addToBookList
but it's a method of 1.8.9
just want to know how to add a new enchantment on 1.11 ( want's some tutorials)
public class EnchantmentFirePower extends Enchantment
{
public EnchantmentFirePower() {
super(Rarity.VERY_RARE, EnumEnchantmentType.DIGGER,
new EntityEquipmentSlot[]{EntityEquipmentSlot.MAINHAND,EntityEquipmentSlot.OFFHAND});
this.setName("firePower");
}
/**
* Returns the minimal value of enchantability needed on the enchantment level passed.
*
* @param enchantmentLevel
*/
@Override
public int getMinEnchantability(int enchantmentLevel) {
return 15;
}
/**
* Returns the maximum value of enchantability needed on the enchantment level passed.
*
* @param enchantmentLevel
*/
@Override
public int getMaxEnchantability(int enchantmentLevel) {
return super.getMaxEnchantability(enchantmentLevel)+50;
}
/**
* Returns the maximum level that the enchantment can have.
*/
@Override
public int getMaxLevel() {
return 1;
}
/**
* Determines if the enchantment passed can be applied together with this enchantment.
*
* @param ench
*/
@Override
public boolean canApplyTogether(Enchantment ench) {
return super.canApplyTogether(ench) && ench.getRegistryType() !=
Enchantments.SILK_TOUCH.getRegistryType()
&& ench.getRegistryType() != Enchantments.FORTUNE.getRegistryType();
//can't apply with silkTouch and fortune together
}
}
public static Enchantment firePower;
public EnchantmentsLoader() {
try{
firePower=new EnchantmentFirePower();
GameRegistry.register(firePower);
}catch(Exception e)
{
e.printStackTrace();
}
}
but i don't know how to enchant it ( i don't is it registered succseful)
i find a method to add a enchant book named
Enchantment.addToBookList
but it's a method of 1.8.9
just want to know how to add a new enchantment on 1.11 ( want's some tutorials)
(poor english, want some understanding)
I actually haven't researched enchantments yet it is on my todo list for my tutorials, but I can definitely point you in the right direction:
From what I gathered in the vanilla code, you need the set up a registry that allows you to register enchantments on the client side. I don't know too much of it, but I recommend looking at GameData class and see how that is set up so you can get a clear understanding of how they register their enchantments. If anybody else in this thread can help you out, I highly encourage it
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey I don't know if you already addressed this or not, sorry if you have but i was wondering which Java Eclipse i should download, theres like 82 different ones xD. Should I download...
First, you should already have some kind of java knowledge beforehand, if this is your first time I recommend Java Installer, which SHOULD give you Eclipse Neon.
Although, as of recent events, I started using Intellij. Eclipse is good, but intellij is much more beginner friendly.
In the end, you should inspect every IDE for yourself, form an opinion, then download whichever one you think might work best for you.
Thanks for the question mate! It was actually a good one that I haven't addressed.
Hey people, just a friendly reminder that I am in a discord server with some other devs and we are looking to expand our reach. If you would like to come and hang out, answer some questions for other devs, or even ask some questions in the #moddinghelp channel, you can!
Here is the link to the discord server. You must have the discord app installed in order to use discord properly.
Ore generation gave me some trouble. It would only spawn veins super clumped up in a one or two chunk radius of 0,0. For a while I thought it wasn't spawning at all. It was caused by having this setup:
// In WorldGenOre.generate()
genSurface(world, random, chunkX, chunkZ);
// chunkX and chunkZ passed unchanged from genSurface() to addOreSpawn() where the block position was calculated like this-
int posX = chunkX + random.nextInt(maxX);
I ran across someone else's setup which multiplied the position by 16:
Now the new ore is spawning in a normal pattern, even in chunks more than 16 chunks away from spawn. I don't understand why that's the case, but I guess this is the correct method.
Yes that is correct, that is because minecraft is set up so that chunks are in a 16X256X16 rectangular cube. Making the position be multiplied by 16 allows it to calculate a position within a chunk this size. I don't know the exact details of how it works, but that's as far as I know.
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Hey, I see you're using Minecraft.getMinecraft().getRenderItem().getItemModelMesher() to register models.
This is out of date and wrong (and has been since 1.10). You should be teaching folks to use ModelLoader.registerCustomModelResourceLocation(...)
Additionally, with 1.11 there are new RegistryEvent<T> events that are fired that are considered the "proper" way to register blocks, items, etc. deprecating the GameRegistry.register(...) methods.
Thanks.
Rollback Post to RevisionRollBack
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.
Of course, I actually HAVE been meddling with the "proper" way of registering. I kept it this "simple" way to get the newbies into the programming mindset, then eventually they will find the proper way useful when they have tinkered with programming for a little while. I am hoping to get back into the swing of things but since I started school again it's hard to keep updating these tutorials. Once I do get back into updating, then I will teach the proper way of registering. Hopefully someone sees your reply here and gets an idea of how to do it properly!
Rollback Post to RevisionRollBack
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Still, remove all references to the ModelMesher. It is very finicky to use and prone to breaking without any good error message.
You want to teach new modders?
Teach them to use the ModelLoader. It can only be called during preInit and always works with meaningful error messages when something fails.
Rollback Post to RevisionRollBack
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.
Please keep this up, I'm really looking forward to your dimension tutorial.
I'm working to make mods for moving our server from bukkit to a forge server, dimensions play a large part of our world and I'm really wanting to port some stuff over.
I guess this is a matter of coding style but I've seen this in other mods so I'm asking out of curiousity:
The initial event listeners in your TutorialMod class you have (as an example):
@EventHandler
public void preInit(FMLPreInitializationEvent event){
proxy.preInit();
}
Shouldn't this be:
@EventHandler
public void preInit(FMLPreInitializationEvent event){
proxy.preInit(event);
}
I realize that the event handlers in proxy, ClientProxy and CommonProxy aren't set up to receive the event variable but shoudn't they be set up that way? If not, what's the rational?
I like this tutorial series. Please keep going with it. Are you planning on doing a tutorial on core mods?
Hello, in the middle of my screen is a Purple Black pattern with the name of the Item above it, help please
That means you haven't connected the texture to the item properly. Black and purple means it doesn't have a texture. You also could've not rendered the item properly.
Yes I believe that is the right one. Try using higher spawn chance if you haven't already. If that doesn't work, would you be able to pm me your code so I can help you properly?
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
hi! just ask how to add a new Enchantment?
i wrote some code like these
but i don't know how to enchant it ( i don't is it registered succseful)
i find a method to add a enchant book named
I actually haven't researched enchantments yet it is on my todo list for my tutorials, but I can definitely point you in the right direction:
From what I gathered in the vanilla code, you need the set up a registry that allows you to register enchantments on the client side. I don't know too much of it, but I recommend looking at GameData class and see how that is set up so you can get a clear understanding of how they register their enchantments. If anybody else in this thread can help you out, I highly encourage it
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
i solved this problem
just override this method of CreativeTab like this
then the enchantment book will bee added
Hey I don't know if you already addressed this or not, sorry if you have but i was wondering which Java Eclipse i should download, theres like 82 different ones xD. Should I download...
"eclipseInstaller
Eclipse IDE for Java EE Developers"
First, you should already have some kind of java knowledge beforehand, if this is your first time I recommend Java Installer, which SHOULD give you Eclipse Neon.
Although, as of recent events, I started using Intellij. Eclipse is good, but intellij is much more beginner friendly.
In the end, you should inspect every IDE for yourself, form an opinion, then download whichever one you think might work best for you.
Thanks for the question mate! It was actually a good one that I haven't addressed.
Hey people, just a friendly reminder that I am in a discord server with some other devs and we are looking to expand our reach. If you would like to come and hang out, answer some questions for other devs, or even ask some questions in the #moddinghelp channel, you can!
Here is the link to the discord server. You must have the discord app installed in order to use discord properly.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Yo, thanks a ton for the reply! I'd love to join your discord but the invite link is expired. :c
Whoops, sorry about that! Here is the unexpired link!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Ore generation gave me some trouble. It would only spawn veins super clumped up in a one or two chunk radius of 0,0. For a while I thought it wasn't spawning at all. It was caused by having this setup:
I ran across someone else's setup which multiplied the position by 16:
Now the new ore is spawning in a normal pattern, even in chunks more than 16 chunks away from spawn. I don't understand why that's the case, but I guess this is the correct method.
Yes that is correct, that is because minecraft is set up so that chunks are in a 16X256X16 rectangular cube. Making the position be multiplied by 16 allows it to calculate a position within a chunk this size. I don't know the exact details of how it works, but that's as far as I know.
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Awesome, thanks for confirming! These tutorials have been super helpful so far. <3
Hey, I see you're using Minecraft.getMinecraft().getRenderItem().getItemModelMesher() to register models.
This is out of date and wrong (and has been since 1.10). You should be teaching folks to use ModelLoader.registerCustomModelResourceLocation(...)
Additionally, with 1.11 there are new RegistryEvent<T> events that are fired that are considered the "proper" way to register blocks, items, etc. deprecating the GameRegistry.register(...) methods.
Thanks.
Of course, I actually HAVE been meddling with the "proper" way of registering. I kept it this "simple" way to get the newbies into the programming mindset, then eventually they will find the proper way useful when they have tinkered with programming for a little while. I am hoping to get back into the swing of things but since I started school again it's hard to keep updating these tutorials. Once I do get back into updating, then I will teach the proper way of registering. Hopefully someone sees your reply here and gets an idea of how to do it properly!
If you would like to get a hold of me somehow, then my discord is @Alex Couch#5275.
Still, remove all references to the ModelMesher. It is very finicky to use and prone to breaking without any good error message.
You want to teach new modders?
Teach them to use the ModelLoader. It can only be called during preInit and always works with meaningful error messages when something fails.
I'm desperate for some good tutorials on mobs, liquids, and dimensions. If you could make tutorials for those, I would be very grateful.
Please keep this up, I'm really looking forward to your dimension tutorial.
I'm working to make mods for moving our server from bukkit to a forge server, dimensions play a large part of our world and I'm really wanting to port some stuff over.
Thanks for this! I haven't really modded past 1.7.10 and that was long enough ago that I didn't even remember how to do the basic setup stuff.
I guess this is a matter of coding style but I've seen this in other mods so I'm asking out of curiousity:
The initial event listeners in your TutorialMod class you have (as an example):
Shouldn't this be:
I realize that the event handlers in proxy, ClientProxy and CommonProxy aren't set up to receive the event variable but shoudn't they be set up that way? If not, what's the rational?
I like this tutorial series. Please keep going with it. Are you planning on doing a tutorial on core mods?
That means you haven't connected the texture to the item properly. Black and purple means it doesn't have a texture. You also could've not rendered the item properly.
Image Removed
~ Everybody's FavouriteDragon
Using item properties, is there a way to shoot a guardian laser, or do we have to make a custom laser entity?
And could you also do a tutorial on custom entities? That would be awesome!
Image Removed
~ Everybody's FavouriteDragon