
flamedragonX2
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by flamedragonX2
-
Try creating a java.util.Random object (import it first). Call it rand and create an int, say int a = rand.nextInt(3) which will make a either 0, 1, or 2 with equal probability. Do a switch statement with a and use each case to determine what will drop
-
[1.7.10] importing mods to make addons
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Bump. Is there a command I can use to map the MCP names to the SRG names so I can actually stop those errors in Eclipse from occuring? Right now there are about a few thousand, and all are apparently caused by SRG names. -
[1.7.10] importing mods to make addons
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Ok, so how do I deobfuscate the mod? -
[1.7.10] importing mods to make addons
flamedragonX2 replied to flamedragonX2's topic in Modder Support
But the addon I'm making requires mods at 1.7.10. -
[1.7.10] importing mods to make addons
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Really nooby post here, but how do I deobfuscate properly? To decompile I used BON and the MCP and then JDGUI, but I have no idea how to deobfuscate. Also, for future reference, what does SRG mean? -
So I want to make an addon involving two different mods. I decompilied the mods (so all the files in them are .java files) and put them in my forge folder, so that Eclipse will see them. However, most of the files (not all) have errors now involving different method names (for example, the blocks in one of the mods use func_149647_a, but the blocks in the MC source that I have use method name "setCreativeTab()". So because the two names are different every single block class in that mod gives "method not found" errors. How can I fix this? I guess I could go through every class but that would be extremely tedious, there has to be another way to have Eclipse recognize "func_149647_a" and every other one of those. Probably did something wrong with MCP...
-
[1.7.10] Getting if a mob was killed by a player or not
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Okay, I understand what you mean now. Gonna try it out... A significant portion of the mods I play (which are still being updated) haven't yet updated to 1.8.9+, though some of them have said they will update soon. I do want them to update eventually but seeing as my entire playstyle revolves around mods like those I'm sticking with 1.7.10. TBH this mod is more of a personal thing for my own experience that I may not even plan to distribute. -
[1.7.10] Getting if a mob was killed by a player or not
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Oh yeah, I found CombatTracker in 1.7.10 and got it to give me a death message, but the thing is I want to use my own custom (random from a selection in a config, the config part is done already) death messages, separate from the original ones. -
[1.7.10] Getting if a mob was killed by a player or not
flamedragonX2 replied to flamedragonX2's topic in Modder Support
What boolean? As to other ways - whenever data vanilla gives you is not sufficient you use IExtendedEntityProperties (now 1.8.9+ @Capability) to store more data. That data can be manipulated from anywhere really (so e.g you can track such actions yourself from e.g LivingHurtEvent). Currently some of such tracking is in mentioned CombatTracker, which idk if existed back then (cmon, it's been 2 years, update). I have to start at 1.7.10, mostly because that's the version significant numbers of the mods are. Maybe later I will update to 1.9 or so (may just skip 1.8.9 entirely). -
So I'd like to make the chat have a death message whenever a (non-named) mob was killed by a player. This is easy for melee/ranged attack kills (I just used LivingDeathEvent), but how would I get if a mob was recently hit by a player before death (i.e. if it is thrown off a cliff or into lava)? For example, if I hit the mob and then it falls into lava, I want a death message spawned. However if it just walks into lava on its own there should be no message. The value in the MC source code that keeps track of this so it can spawn XP orbs and stuff is protected so I can't get to it... Is there a way to get a boolean that tells you this?
-
I'm trying to make a creeper-like mob (it extends EntityCreeper) that explodes and then burns all mobs in an x-block radius. The explosion works fine but the burning code (specifically the part that gets all mobs in the radius) is giving me an NPE "exception ticking entity". Is there a better way to do this? Code below: List<EntityLiving> theList = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, this.getBoundingBox().expand(eR, eR, eR));. //This line is the code referenced during the crash report for(EntityLiving entity: theList) { if(entity != null) { entity.setFire(; } }
-
By "custom portal block" I meant the actual portal block (i.e. the one that you touch that sends you to the other dimension). Do I put onBlockActivated() there? It sounds like you're talking about the portal frame.
-
bump
-
Where is the code (which class) that causes a portal to be created if a fire block gets on a certain frame of obsidian? How can I modify it to use my own custom lighting item (not fire) to activate, if I decide to do so? I've already made the portal block but I just want to be able to light a portal and get it rather than spawning it in all the time.
-
In a mod I'm making I want structures to generate randomly all across a dimension. For example, a chunk would have a 1 in 200 chance of containing said structure. How would I implement this? The thing is the only mod I know that does stuff exactly like this is a closed-source mod that I don't want to use and get in trouble for so I want some public help that I know is copyright-free. Right now I'm looking to edit the chunkprovider's populate() method. Worlds with the same seed should generate the structures in the exact same place.
-
[1.7.10] NullPointerException during harvest event
flamedragonX2 replied to flamedragonX2's topic in Modder Support
Thanks. Unfortunately I don't know how to trigger the crash (it happens randomly quite occasionally), but I will try this. Got any other checks that may be important? -
So I created a pickaxe that when mining stone drops my custom block, and has a 25% chance to set the player on fire when mining a block. Code for harvest event below: (Note: some of it is obfuscated with xxxx to keep names a secret) @SubscribeEvent public void xxxxPick(HarvestDropsEvent event) { ItemStack theTool = event.harvester.getCurrentEquippedItem(); //[b]THIS[/b] is line 38, which was mentioned in the crash report if(theTool != null) { if(theTool.getItem() == ToolManager.xxxxPickaxe) { if(random.nextInt(4) == 0) { event.harvester.setFire(5); } if(event.block != null) { if(event.block == Blocks.stone) { event.drops.clear(); event.drops.add(new ItemStack(Item.getItemFromBlock(myBlocksClass.myCustomStone))); } } } } However, occasionally I get a crash report, stating a NullPointerException has occured doing my custom pick event. This really confuses me since I checked to see if both the block and the ItemStack for the tool are not null before using them. Example below: Any idea what could be causing it? It says "BlockBush" in the crash report somewhere but the crash tends to occur half a minute after breaking a dead bush, if I broke one.
-
Darn it, I've run into another problem. So I created a pickaxe that when mining stone drops my custom block, and has a 25% chance to set the player on fire when mining a block. Code for harvest event below: (Note: some of it is obfuscated with xxxx to keep names a secret) @SubscribeEvent public void xxxxPick(HarvestDropsEvent event) { ItemStack theTool = event.harvester.getCurrentEquippedItem(); if(theTool != null) { if(theTool.getItem() == ToolManager.xxxxPickaxe) { if(random.nextInt(4) == 0) { event.harvester.setFire(5); } if(event.block != null) { if(event.block == Blocks.stone) { event.drops.clear(); event.drops.add(new ItemStack(Item.getItemFromBlock(myBlocksClass.myCustomStone))); } } } } However, occasionally I get a crash report, stating a NullPointerException has occured doing my custom pick event. This really confuses me since I checked to see if both the block and the tool are not null before using them. Example below: Any idea what could be causing it? It says "BlockBush" in the crash report somewhere but the crash tends to occur half a minute after breaking a dead bush, if I broke one.
-
So I'm making a mod, and I want a tool that, when mining certain blocks, has the block drop something different (not all blocks, just certain ones). For example, mining block A may drop block A, but mining block B will make it drop item C or block D. Kind of like Twilight Forest's fiery pick, except only for a few specific blocks (not anything with a smelting recipe). How would I go about doing this? Logically I'd go about doing something to the tool's onBlockDestroyed() method, but I don't know exactly what to do about it. And this is not something that I can easily search up modding tutorials for as it is not something commonly attempted. And, if one of the blocks I want to check for is stone, would this code be appropriate for checking if the block is stone? if(block.getIdFromBlock(block) == block.getIdFromBlock(Blocks.stone)) { //drop a different block here } And finally, what would be the code for spawning a dropped item? Not sure if I need it here or not, but I think it may help in the future.