What cool little thing have you discovered today?

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Baron_Falcon

New Member
Jul 29, 2019
433
3
0
I liked the quarry plus markers to set markers for Ender quarry :D

The last time I ran one in the nether it caused so much lag from all the little fire rats that I could barely move. However I got about 50 XP in 30 seconds killing all of them
 

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
I'm learning to mod. I discovered something cool while attempting to make Bedrockium armor a thing (infinite durability, diamond protection, large slowdown, increased fall damage if I can get that working...). The second parameter when creating an ArmorMaterial, which the tutorial I'm following claims is durability, is (at the very least) also something that influences damage taken. Setting it to a negative value will actually increase the damage taken, which I think is pretty cool. What's more is that this fact is not immediately visible to the player; you can set the armor to have what looks like diamond level protection on the armor bar while simultaneously setting this "durability" value to be negative.
*rubs hand evilly*
Aside from the obvious trolling applications, this could be cool for a sort of "scout" armor that increases damage taken but also increases, say, speed, or berserker armor with a similar effect only with strength. :)
Actually, I still need help on that Bedrockium Armor infinite durability. If someone could help me with that in a PM or something, it'd be great. :p

EDIT: I now have diamond level protection working, but not infinite durability. It's set at several millions of durability points, but that lack of true infinite durability bugs me conceptually. :p
 
Last edited:
  • Like
Reactions: The Mobius Archives

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
I'm learning to mod. I discovered something cool while attempting to make Bedrockium armor a thing (infinite durability, diamond protection, large slowdown, increased fall damage if I can get that working...). The second parameter when creating an ArmorMaterial, which the tutorial I'm following claims is durability, is (at the very least) also something that influences damage taken. Setting it to a negative value will actually increase the damage taken, which I think is pretty cool. What's more is that this fact is not immediately visible to the player; you can set the armor to have what looks like diamond level protection on the armor bar while simultaneously setting this "durability" value to be negative.
*rubs hand evilly*
Aside from the obvious trolling applications, this could be cool for a sort of "scout" armor that increases damage taken but also increases, say, speed, or berserker armor with a similar effect only with strength. :)
Actually, I still need help on that Bedrockium Armor infinite durability. If someone could help me with that in a PM or something, it'd be great. :p
override things?

Also, that is weird...durability really shouldn't influence damage taken. However, the scout and berserker idea is interesting, and fairly easy to make...
 
  • Like
Reactions: Type1Ninja

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
override things?

Also, that is weird...durability really shouldn't influence damage taken. However, the scout and berserker idea is interesting, and fairly easy to make...
Yeah. This is probably something everyone says when they first learn modding, but holy sh*t there's so much I can do. XD
Maybe this is just a good standalone mod idea - armors with various effects (or even armors that remove effects).
So, I've managed to get durability in the millions and protection that is diamond armor, as well as applying Slowness II whenever a player is wearing any piece of the armor (I'm currently working on having greater status effects for more armor pieces; it's shaping up well). As I said, though, there isn't true theoretical infinite durability, and it looks like there isn't anything to override. While it's easy with ISpecialArmor, from forge, having regular armor protection then becomes a chore to get working. :(
I'm now looking into directly setting the metadata to the max... I'll edit this post/post a new post if I get that (or anything) working.
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
Yeah. This is probably something everyone says when they first learn modding, but holy sh*t there's so much I can do. XD
Maybe this is just a good standalone mod idea - armors with various effects (or even armors that remove effects).
So, I've managed to get durability in the millions and protection that is diamond armor, as well as applying Slowness II whenever a player is wearing any piece of the armor (I'm currently working on having greater status effects for more armor pieces; it's shaping up well). As I said, though, there isn't true theoretical infinite durability, and it looks like there isn't anything to override. While it's easy with ISpecialArmor, from forge, having regular armor protection then becomes a chore to get working. :(
I'm now looking into directly setting the metadata to the max... I'll edit this post/post a new post if I get that (or anything) working.
couldn't you override it in ItemArmor? Or something else. Also with ISpecialArmor you could have a regular armor object to delegate to inside of it, making everything easy peasy. Then when you need to do something special you just apply it to the regular armor object. For example on attack you could set the armor durability on the regular armor to max
 

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
couldn't you override it in ItemArmor? Or something else. Also with ISpecialArmor you could have a regular armor object to delegate to inside of it, making everything easy peasy. Then when you need to do something special you just apply it to the regular armor object. For example on attack you could set the armor durability on the regular armor to max
I DID IT
I had to do some digging, but I finally found the thing I need to do. There's a method for ItemStacks called "attemptDamageItem()," taking an integer and a random number generator. The method onArmorTick(), which is specific to armors, has an ItemStack as a parameter, which I (correctly) assumed to be the ItemStack of the armor itself. So, I've set it so that every time onArmorTick is called, I call attemptDamageItem() on that armor piece, but instead of passing a regular positive number, I pass a negative number. This actually repairs the armor, which is awesome. :D
This results in infinite durability (and no ugly durability bars) for the armor. You can get punched by zombies, sitting with your inventory open, and you'll never see that durability drop. :)
EDIT: Logging off for the night. Fun talking about programming. :)
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
I DID IT
I had to do some digging, but I finally found the thing I need to do. There's a method for ItemStacks called "attemptDamageItem()," taking an integer and a random number generator. The method onArmorTick(), which is specific to armors, has an ItemStack as a parameter, which I (correctly) assumed to be the ItemStack of the armor itself. So, I've set it so that every time onArmorTick is called, I call attemptDamageItem() on that armor piece, but instead of passing a regular positive number, I pass a negative number. This actually repairs the armor, which is awesome. :D
This results in infinite durability (and no ugly durability bars) for the armor. You can get punched by zombies, sitting with your inventory open, and you'll never see that durability drop. :)
Good job, these are the kinds of problems that are the bread and butter of mc modding, working with the god awful restrictions mojang sometimes has :p
trust me, you haven't seen the half of it
EDIT: Logging off for the night. Fun talking about programming. :)
Gnight, but this was not a talk about programming :p

Mc modding...maybe
 
  • Like
Reactions: Type1Ninja

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
Good job, these are the kinds of problems that are the bread and butter of mc modding, working with the god awful restrictions mojang sometimes has :p
trust me, you haven't seen the half of it

Gnight, but this was not a talk about programming :p

Mc modding...maybe
I was tired, and programming was the most relevant word that came to mind (the rest were all in camelCase...). :p
Now... Let's figure out how LIGHTNING works! :D
See you when the modding API is released. ;)
 

Inaeo

New Member
Jul 29, 2019
2,158
-3
0
We need a new such thing since Guns'n'Roses released Chinese Democracy and Duke Nukem Forever has come out.

The Minecraft modding API is a perfect substitute ;)

And fittingly enough, both these things were far worse than people had hoped for, even though their expectations were already subbasement low. This matches the bar pretty well, I'd say.

Not meaning to be negative, just realistic. I sincerely hope I'm wrong.
 

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
I discovered while attempting to code a lightning maker that lightning doesn't render if... Well, I'm not sure what the conditional is, but apparently a player needs to be involved somehow somewhere. My block makes lightning if right-clicked - that works fine - and also makes lightning if you give it a redstone signal, but the lightning doesn't render. The sound plays and fire happens, but no actual lightning. :(
The only difference between the two methods - onBlockActivated() (click, which works) and onNeighborBlockChanged() (redstone, which doesn't quite work) - is that onBlockActivated is passed an EntityPlayer, while onNeighborBlockChanged isn't passed one. EntityPlayer isn't even used in onBlockActivated, though... Which is why I'm confused. >.<
To top off this part-uncool-thing-part-bug-report-part-plea-for-help, here's my code (which I think is well-written, even if it doesn't quite work):
Code:
public class BlockLightningCreator extends BlockXF {
    public static double lightningYOffset = 5.0D;
   
    public BlockLightningCreator(String unlocalizedName) {
        super(unlocalizedName);
    }
   
    public void spawnLightning(World world, int x, int y, int z) {
        LogHelper.info("Lightning creator created lightning");
        EntityLightningBolt lightning = new EntityLightningBolt(world, x, y + lightningYOffset, z);
        world.spawnEntityInWorld(lightning);
    }
   
    //Create lightning if right clicked
    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
        spawnLightning(world, x, y, z);
        return true;
    }
   
    //Create lightning if powered by redstone
    //TODO - works, but lightning isn't rendered. -_-
    public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
        if (!world.isRemote) {
            if (world.isBlockIndirectlyGettingPowered(x, y, z)) {           
                spawnLightning(world, x, y, z);
            }
        }
    }
}
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
I discovered while attempting to code a lightning maker that lightning doesn't render if... Well, I'm not sure what the conditional is, but apparently a player needs to be involved somehow somewhere. My block makes lightning if right-clicked - that works fine - and also makes lightning if you give it a redstone signal, but the lightning doesn't render. The sound plays and fire happens, but no actual lightning. :(
The only difference between the two methods - onBlockActivated() (click, which works) and onNeighborBlockChanged() (redstone, which doesn't quite work) - is that onBlockActivated is passed an EntityPlayer, while onNeighborBlockChanged isn't passed one. EntityPlayer isn't even used in onBlockActivated, though... Which is why I'm confused. >.<
To top off this part-uncool-thing-part-bug-report-part-plea-for-help, here's my code (which I think is well-written, even if it doesn't quite work):
Code:
public class BlockLightningCreator extends BlockXF {
    public static double lightningYOffset = 5.0D;
  
    public BlockLightningCreator(String unlocalizedName) {
        super(unlocalizedName);
    }
  
    public void spawnLightning(World world, int x, int y, int z) {
        LogHelper.info("Lightning creator created lightning");
        EntityLightningBolt lightning = new EntityLightningBolt(world, x, y + lightningYOffset, z);
        world.spawnEntityInWorld(lightning);
    }
  
    //Create lightning if right clicked
    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
        spawnLightning(world, x, y, z);
        return true;
    }
  
    //Create lightning if powered by redstone
    //TODO - works, but lightning isn't rendered. -_-
    public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
        if (!world.isRemote) {
            if (world.isBlockIndirectlyGettingPowered(x, y, z)) {          
                spawnLightning(world, x, y, z);
            }
        }
    }
}
Yeah, this is nothing new...I can't remember the correct lightning code to get it to render...Google it?
 
  • Like
Reactions: Type1Ninja

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
Yeah, this is nothing new...I can't remember the correct lightning code to get it to render...Google it?
I doubt something so specific will show up (but I'll try anyway ;)). I'm currently trying to find where the Minecraft code controlling the rendering of lightning is - do you know?
And yeah, I mentioned it before, but that was before I knew anything about modding. Now it's from a new, even more headache inducing perspective. :p
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
I discovered while attempting to code a lightning maker that lightning doesn't render if... Well, I'm not sure what the conditional is, but apparently a player needs to be involved somehow somewhere. My block makes lightning if right-clicked - that works fine - and also makes lightning if you give it a redstone signal, but the lightning doesn't render. The sound plays and fire happens, but no actual lightning. :(
The only difference between the two methods - onBlockActivated() (click, which works) and onNeighborBlockChanged() (redstone, which doesn't quite work) - is that onBlockActivated is passed an EntityPlayer, while onNeighborBlockChanged isn't passed one. EntityPlayer isn't even used in onBlockActivated, though... Which is why I'm confused. >.<
To top off this part-uncool-thing-part-bug-report-part-plea-for-help, here's my code (which I think is well-written, even if it doesn't quite work):
Code:
public class BlockLightningCreator extends BlockXF {
    public static double lightningYOffset = 5.0D;
  
    public BlockLightningCreator(String unlocalizedName) {
        super(unlocalizedName);
    }
  
    public void spawnLightning(World world, int x, int y, int z) {
        LogHelper.info("Lightning creator created lightning");
        EntityLightningBolt lightning = new EntityLightningBolt(world, x, y + lightningYOffset, z);
        world.spawnEntityInWorld(lightning);
    }
  
    //Create lightning if right clicked
    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) {
        spawnLightning(world, x, y, z);
        return true;
    }
  
    //Create lightning if powered by redstone
    //TODO - works, but lightning isn't rendered. -_-
    public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
        if (!world.isRemote) {
            if (world.isBlockIndirectlyGettingPowered(x, y, z)) {          
                spawnLightning(world, x, y, z);
            }
        }
    }
}
Another thing about this. If the block is updated by say a block being placed by it and it is powered by redstone it will fire a lightning bolt. You need to store the last value of the redstone in metadata and check if it changed to true
 

Strikingwolf

New Member
Jul 29, 2019
3,709
-26
1
I doubt something so specific will show up (but I'll try anyway;) ). I'm currently trying to find where the Minecraft code controlling the rendering of lightning is - do you know?
I don't know where that would be...somewhere in the Weather controllers?
And yeah, I mentioned it before, but that was before I knew anything about modding. Now it's from a new, even more headache inducing perspective. :p
Trust me, that's not even the most egregious thing Mojang has done...have you read the #BlameMojang thread :p
 

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
I don't know where that would be...somewhere in the Weather controllers?

Trust me, that's not even the most egregious thing Mojang has done...have you read the #BlameMojang thread :p
Hmm... I think rendering for lightning would somehow happen inside of the Entity renderer... So somehow lightning is treated differently as an entity, as far as I can tell, although I may be wrong. Do you know which mods add lightning code that works? Do you know if any of them are open source? Do you know if the authors of the not-open-source ones would respond to being pinged? :p
If nobody can get any leads there, I'll probably drop this for the night... Lightning is hard. :confused:
Also, I could use help on my post on making recipes using items form other mods. That's a big issue too.
Thanks for all the help and support, though. This community is surprisingly great for advice on making mods as well as playing with them. :)
 

ICountFrom0

Forum Addict
Aug 21, 2012
905
1,219
159
Vermont
I'm learning to mod. I discovered something cool while attempting to make Bedrockium armor a thing (infinite durability, diamond protection, large slowdown, increased fall damage if I can get that working...). The second parameter when creating an ArmorMaterial, which the tutorial I'm following claims is durability, is (at the very least) also something that influences damage taken. Setting it to a negative value will actually increase the damage taken, which I think is pretty cool. What's more is that this fact is not immediately visible to the player; you can set the armor to have what looks like diamond level protection on the armor bar while simultaneously setting this "durability" value to be negative.
*rubs hand evilly*
Aside from the obvious trolling applications, this could be cool for a sort of "scout" armor that increases damage taken but also increases, say, speed, or berserker armor with a similar effect only with strength. :)
Actually, I still need help on that Bedrockium Armor infinite durability. If someone could help me with that in a PM or something, it'd be great. :p

EDIT: I now have diamond level protection working, but not infinite durability. It's set at several millions of durability points, but that lack of true infinite durability bugs me conceptually. :p


This explains why the tinkers construct armor is not as protective as it looks.
 
  • Like
Reactions: Type1Ninja