
SnakeBlock
Members-
Posts
16 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
SnakeBlock's Achievements

Tree Puncher (2/8)
0
Reputation
-
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Looks like 'durabilityRemainingOnBlock' is a private int. How would I access it? w.sendBlockBreakProgress(p.getEntityId(), newpos, (PlayerInteractionManager.durabilityRemainingOnBlock)); As you can probably see from the code, I'm confused about PlayerInteractionManager as a whole. Could use some help here! -
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Thank you so so so much! Final question: Is there any way to see a block's breaking progress? Like which animation state it is in. Want to use the sendBlockBreakProgress method on Stone Blocks around the block the player is mining (yes, I'm doing a multi-break system and it worked because of the help , this is just aesthetic), so I really just need the progress of the specific block the player is mining. Can't exactly see any methods or anything on my BlockState that gets the progress, though. -
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Sorry for the bombarding of dumb questions, I really want to figure this out. But I can't seem to find an event for a player breaking a block - just starting to break one, apparently. Is there an event that calls after the player breaks a block? -
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Ahh, thank you. I'll research events. Any specific good place you know that has basic information on events? -
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Well, I'm not sure if I completely understand but seems like the ItemStack of the Item is the Item that has the code that has the overridden method? If so, how would I affect pickaxes and pickaxes _only_, even if the overridden method is in a non-pickaxe item? Basically like some kind of buff to pickaxes as a whole, which is what I'm going for. -
2 questions about destroying blocks [Forge 1.11.2]
SnakeBlock replied to SnakeBlock's topic in Modder Support
Thank you! Also, a small question about onBlockDestroyed: I'm guessing that "ItemStack stack" in its params basically is the tool/whatever that the block is destroyed by? Correct me if I'm wrong. Because I overrid onBlockDestroyed in a non-tool, non-pickaxe item (since I assumed that it'd do something , and it's not even doing anything. Sorry if this is a weird question, I'm a bit confused about this. -
I know the title doesn't describe much, but I'm gonna try to explain. 1. How would I erase a block? AKA turn it into air, like /setblock ~ ~ ~ air? Apparently you need 'blockstates', but I'm gonna need a bit more of an explanation to that that caters to what I'm trying to do specifically here. Anyway I'd just appreciate it if somebody could tell me how to turn blocks into other blocks at all. 2. Completely optional question, because I'm not even sure if it's possible - and even if it is it's probably really complicated and I'm not sure if I want to undertake something TOO complicated, as what I'm going for is literally just a visual effect and will not affect gameplay in any way. Is it... possible to show the block breaking animation on a block that isn't being broken? To fake it being actually broken and all. I guess I can handle the particle effects myself. Thank you for answering all my prior questions perfectly and being such a competent/patient community! I'm starting to get used to forge.
-
I have a NBT tag called "ConsumedAmount" on an item. Got everything about it working very well, but as a sort of 'final touch', I want to add a durability bar. However, this durability bar should use the ConsumedAmount. So if it's 0/there is no tag compound/ConsumedAmount key then it won't display, 1 then it'll be super low, all the way up to 32 which would be full. Is there any way I can accomplish this? I've noticed that a mod like EnderIO has a 'durability bar' that uses RF instead of actual durability (I've only seen this for the Staff of Travelling so far, though). I don't exactly want the custom gradient that it uses, but just something like that. As a completely optional question (and I hope this isn't too complex...), is it possible to change the bar's color at a certain value? Not gradually change it overtime like vanilla's, but literally change the entire color. So green to gray, gray to gold, etc. etc..
-
Stumped on this same thing. I want the item from an earlier thread of mine to change textures when the NBT "Amount" is set. Would appreciate help!
-
[Forge 1.11.2] "Dynamic" item lore that shows a (custom) NBT tag?
SnakeBlock replied to SnakeBlock's topic in Modder Support
Ha, can't believe I never thought of that! Thank you all so much, it works perfectly! -
[Forge 1.11.2] "Dynamic" item lore that shows a (custom) NBT tag?
SnakeBlock replied to SnakeBlock's topic in Modder Support
So. I've been playing around with your suggestion, along with some extra help from Google. https://pastebin.com/Xfh8fp3F I've removed the onUpdate thing and did this instead. Although, Eclipse gives me an error... "The method onItemRightClick(ItemStack, World, EntityPlayer) of type Item_IronInfusedGemstone must override or implement a supertype method" I know why this is happening - it's because the onItemRightClick line should be "public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer p, EnumHand h)", like it is in the method I'm actually overriding. But this raises the question for me, how would I use a method parameter for the right click along with the addInformation? Just doing "World worldIn, EntityPlayer p, EnumHand h, ItemStack stack" gives me an error. I'd imagine I'm probably talking nonsense right now - apologies, seriously. I just want to get this working. -
[Forge 1.11.2] "Dynamic" item lore that shows a (custom) NBT tag?
SnakeBlock replied to SnakeBlock's topic in Modder Support
It's just an item stack of the item the code is running in. ItemStack SelfStack = new ItemStack(this); Here's every part of the code that relates to my problem/what I want, in question: Pastebin -
I have an item with a custom NBT tag called "ConsumedAmount". This works, but I also want some form of a 'dynamic' lore, that shows the NBT tag. Like "Amount: >ConsumedAmount<". You can increase the NBT tag (integer) by 1 every time you right click using an overridden onItemRightClick. I've tried to convert the integer into a string and concatenate it with "Amount: " in my addInformation, but it stays at 0. I've tried to change the NBT tag manually to 1000 from the code as a debug inside of the addInformation, and it appears to 'flicker' between 1000 and 0 rapidly. But it doesn't show any changes from outside the addInformation and in the onItemRightClick at all. I've been trying to get this to work for a while now, but no dice. It stays at 0. Any help? @Override public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { int ConsumedAmountNBT = (SelfStack.getTagCompound().getInteger("ConsumedAmount")); par3List.add("\u00A77Hold right click to consume \u00A7fIron Ingots\u00A77, and gain buffs."); par3List.add(""); par3List.add("\u00A7eAmount consumed: \u00A76" + Integer.toString(ConsumedAmountNBT)); } I can send the entire code including the onItemRightClick if necessary (just ask).