
shieldbug1
Forge Modder-
Posts
404 -
Joined
-
Last visited
Everything posted by shieldbug1
-
Item.getItemFromBlock seems to be returning null. Try registering to the OreDictionary in the init method (the one with the FMLInitializationEvent, rather than the FMLPreInitializationEvent).
-
[1.7.10] Making a block invisible based on gamemode
shieldbug1 replied to MarkSill's topic in Modder Support
I'm not sure what order they get called in. Just keep trying different ones until it works -
That's very weird. Have you tried registering it as a new ItemStack? That shouldn't make a difference, but it doesn't hurt to try.
-
Post your Stuff and your Main classes.
-
[1.7.10] Making a block invisible based on gamemode
shieldbug1 replied to MarkSill's topic in Modder Support
Override one of the getIcon methods. Since they're all on the client side you can safely use Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode and just return the texture you want. (Make sure to override isBlockNormalCube or one of those methods to make sure you can have an invisible block, I can never remember which method does that. ) -
Thank you very much.
-
I'd like to do something whenever something happens to a vanilla EntityItem, for example its within a certain fluid, within a range away from another EntityItem of a different type, etc. I know how to perform the checks, but I don't know where to place them. Is there a place I can do these checks in? I haven't found any events that seem to work for it, yet. I have tried EntityEvent.CanUpdate, ItemTossEvent and ItemExpireEvent. The closest I got was setting the age of the entityItem to 5999 in the ItemTossEvent, then cancelling the ItemExpireEvent and adding 1 to the extraLife variable so that ItemExpire gets called every tick, but this seems very hacky and the item won't ever 'die' (unless I add my own tick counter that sets the extraLife to 0 and uncancels the event after 6000 times of getting called, yet this still seems very hacky).
-
[1.6.4] How i can catch the mob, who dropped experience orb?
shieldbug1 replied to Try4W's topic in Modder Support
You could create your own event and make a PR on the official github. -
[1.6.4] How i can catch the mob, who dropped experience orb?
shieldbug1 replied to Try4W's topic in Modder Support
Since Experience Orbs are entities I'd assume they're still spawned, so you can mess around with things like LivingSpawnEvent.CheckSpawn or LivingSpawnEvent.SpecialSpawn. Maybe even the EntityConstructingEvent. Another option might be to subscribe to LivingDeathEvent, and then make it die in a way that you define, that might work. The last resort I can think of right now is that if none of the above work, you can try using the spawn events to make every creeper spawned actually spawn an instance of your own creeper class that extends EntityCreeper or whatever its called, and then override that method there. This would probably be a bad idea though, as it can mess with compatibility with other mods. -
I'll try that when I get home. Thanks
-
[SOLVED][1.7.10] Crash when processing ObjectHolder annotations
shieldbug1 replied to penguinsfan77's topic in Modder Support
Your ModItems class has the ObjectHolder annotation and contains arrays. There's your culprit. -
[SOLVED][1.7.10] Crash when processing ObjectHolder annotations
shieldbug1 replied to penguinsfan77's topic in Modder Support
That's really weird then. Do you do anything weird when registering things to the GameRegistry? -
Well, yeah. Of course they are. They work fine too. And they extend classes that other items and blocks that aren't giving this message extend too.
-
[SOLVED][1.7.10] Crash when processing ObjectHolder annotations
shieldbug1 replied to penguinsfan77's topic in Modder Support
Post the class you put the @ObjectHolder annotation on. -
This message: [11:09:40] [server thread/WARN] [FML]: Unable to lookup ForestMagic:goldenBerylOre for public static com.shieldbug1.forestmagic.block.ore.BlockOreFM com.shieldbug1.forestmagic.init.ModBlocks.goldenBerylOre. Is there something wrong with the registry? [11:09:40] [server thread/WARN] [FML]: Unable to lookup ForestMagic:magicLeaves for public static com.shieldbug1.forestmagic.block.BlockFM com.shieldbug1.forestmagic.init.ModBlocks.magicLeaves. Is there something wrong with the registry? [11:09:40] [server thread/WARN] [FML]: Unable to lookup ForestMagic:goldenBerylGem for public static com.shieldbug1.forestmagic.item.gem.ItemGemFM com.shieldbug1.forestmagic.init.ModItems.goldenBerylGem. Is there something wrong with the registry? appears every time in the preinitialisation stage. When the game is run, the message comes from the Client thread, and when a world is loaded it's from the Server thread. It also appears when a world is being unloaded on the server thread. The blocks and items it mentions work fine, and I didn't register them any differently to any of my other blocks or items. Here is the relevant code: public static final ItemGemFM goldenBerylGem = new ItemGoldenBerylGem(); // And later, in my method for registering the blocks and items GameRegistry.registerItem(goldenBerylGem, Names.Items.Gems.GOLDEN_BERYL_GEM); Am I doing something horribly wrong and not seeing it, or should I just ignore the message? EDIT: If it matters I'm using forge version 10.13.0.1180 (1.7.10). (I've just been too lazy to update, but I don't think the version has anything to do with this.) EDIT: I have updated to the latest version of forge (1199) and the message still occurs.
-
[1.6.4] How i can catch the mob, who dropped experience orb?
shieldbug1 replied to Try4W's topic in Modder Support
Do you mean to do something whenever a mob drops experience? You can use LivingDropsEvent or PlayerPickupXpEvent. I'm not exactly sure what you want to do, but these seem like a good place to start. -
You need to return the Item you want dropped and an integer of how much. Don't forget to use @Override to make sure you typed the method names and signature correctly.
-
Again, really simple java (unless I'm mis-reading something completely). You're trying to invoke a constructor for TileEntityHydrogenSeparator with InventoryPlayer and a TileEntityHydrogenSeperator as arguments. Yet, in your your TileEntityHydrogenSeparator class you don't define any constructors, meaning you only have the default, no args constructor.
-
Look at your own line. ((TileEntity) world.getTileEntity(x,y,z).setGuiDisplayName(itemstack.getDisplayName()); Why are you casting an object of type TileEntity to TileEntity? TileEntity does not have a method setGuiDisplayName(String name). You need to cast to your own TileEntity class (TileEntityHydrogenSeparator?). This is pretty basic java.
-
I had a similar problem to this - since the potion effect gets given again every tick, it never actually DOES anything since it keeps getting reset. You could make it give it for 10 ticks and then use something like world.getWorldTime() % 10 == 0 so that it only reapplies approximately twice a second and see if it helps.
-
Um. What? The things don't relate to each other at all. Bit wise operator are just like normal operators. AND, OR, XOR, etc. I think what you mean is using bit wise operators in conjunction with metadata. Block metadata is one byte (0 to 15, or 0000 to 1111). You'd need two bits of data to save the orientation of the door, and one bit of data to save whether the door is open or not.
-
getItemDropped and getQuantityDropped.
-
This looks like you're just copy pasting entire vanilla classes now. Do you even know what some of those methods do?
-
Asking for code shows laziness and an attitude of 'can you write my mod for me'. Try to do it yourself, look at tutorials and other forum threads which might relate, and after you feel like you've tried everything you come here, tell us what you tried, show your attempt in code, and then we help you.
-
WorldSavedData is what you're looking for, I believe.