Choonster
Moderators
-
Joined
-
Last visited
-
Currently
Viewing Topic: Cannot find client log entries
Everything posted by Choonster
-
The entity load whit the incorrect texture and model
You have two classes registering entities for the same mod, each with their own ID counter. This means that you register two entities with ID 1, two entities with ID 2, etc. When you spawn an entity on the server, FML sends the ID to the client so it can spawn the entity. If you have multiple entities with the same ID, the client will spawn a different entity to the server. Either register all of your entities in the same class or use the same ID counter for both classes. Why are you maintaining your own ID to name maps? Why do you have copies of EntityRegistry.addSpawn/removeSpawn? You cannot reference client-only classes (like models) in common code, you need to use proxies. You should be registering IForgeRegistryEntry implementations (Block, Item, Biome, etc.) in the corresponding registry events rather than in preInit. Doing this will make it easier to update to 1.12.x, where GameRegistry.register is private. In future, please post one class per code block or post your code using Gist/Pastebin (one class per file in a Gist or one class per Pastebin paste). Alternatively, create a Git repository for your mod and push it to a site like GitHub.
-
[1.10.2] display section in Forge Blockstate file doesn't work
Forge's blockstates file doesn't use that format for display transformations, only Vanilla item models do. I briefly explain display transformations in Forge's blockstates format here: In addition to specifying a base TRSRTransformation in the "transform" object, you can specify a TRSRTransformation for each ItemCameraTransforms.TransformType ("thirdperson_righthand", "firstperson_lefthand", "gui", etc.). The complex example I linked in the quoted post uses this to specify a TRSRTransformation for "thirdperson" (which Forge treats as an alias of "thirdperson_righthand") and "gui".
-
[1.12] GuiScreen setup with drawTexturedModalRect
You're calling Gui#drawTexturedModalRect once when the GUI is first opened, which does nothing. You need to call it every frame (in your override of GuiScreen#drawScreen).
-
/assets/[mod]/recipes copied directly into jar without being processed; no recipes are loaded
JSON recipes were only added in 1.12, you're using 1.11.2.
-
1.7.10 Problems with rendering a tag above name (opengl)
Not supported doesn't mean that it's not possible to make mods for 1.7.10, it just means that you won't get help with it on this site.
-
Bug loading my mod
I'm not familiar with the plugin, do you not have access to the Gradle window?
-
Get damage dealt in AttackEntityEvent?
The damage hasn't been calculated when AttackEntityEvent is fired, use LivingHurtEvent instead.
-
Bug loading my mod
Run the build task from IDEA's Gradle window or the command line. The compiled JAR will be in build/libs.
-
Bug loading my mod
You didn't answer diesieben07's question. Did you build the JAR using IDEA's build system or did you build it using the build Gradle task? Only the latter is correct.
-
My items have durability but it only takes one off of the whole durability
Item#setDamage sets the ItemStack's damage to the specified amount. You call it with 1, so it sets the ItemStack's damage to 1. The method you want is ItemStack#damageItem, which increments the ItemStack's damage by the specified amount. Calling with 1 will add 1 to the damage. Side note: Don't use Item#setDamage directly, use ItemStack#setItemDamage when you want to set the ItemStack's damage instead.
-
[1.10.2] Get ingredients from Crafting Recipe
Then you'll need to handle each recipe class individually. For Vanilla's shaped/shapeless recipes, look for a field containing the collection of ItemStack ingredients. For Forge's ore recipes, look for a field containing the collection of Object ingredients. Each Object can be either an ItemStack or a List<ItemStack>. I strongly recommend updating to 1.12.1.
-
[1.10.2] Get ingredients from Crafting Recipe
Which version of Minecraft are you using? In 1.12+, use IRecipe#getIngredients to get a list of Ingredients in a recipe and Ingredient#getMatchingStacks to get a list of ItemStacks matched by an Ingredient. IRecipe#getIngredients returns an empty list for special recipes with harcoded ingredients (e.g. RecipeBookCloning, RecipeFireworks, etc.), it only returns a non-empty list for recipes that use a collection of Ingredient objects (e.g. ShapedRecipes, ShapelessRecipes, ShapedOreRecipe and ShapelessOreRecipe).
-
Broken Model Textures 1.11.2 forge: 13.20.1.2454
The model you specified in the blockstates file doesn't exist.
-
[1.6.4] Get the Resource/Resource location of any item.
Items and blocks no longer have textures, they now have models. Use RenderItem#getItemModelWithOverrides to get the model for an item.
-
[1.10] Prevent automation extract from specific slots
Create a regular ItemStackHandler to store the inventory and use this in your Container. Create an IItemHandlerModifiable wrapper class that stores another IItemHandlerModifiable and delegates all methods to it except IItemHandler#extractItem. Implement this to always return ItemStack.EMPTY, preventing extraction from the wrapped inventory. Create an instance of this that wraps the regular ItemStackHandler and then expose this via your TileEntity's override of ICapabilityProvider#getCapability.
-
[1.7.10][1.11.2]First Person 3D items with animations
Forge has a model animation system, but unfortunately there's not much documentation on it. It was introduced in this commit, which briefly explains the purpose of some of the classes. The grammar of the Animation State Machine files is documented here. Forge has an example here (assets), there are also some examples linked here. This can animate JSON and B3D models, but unfortunately it can't animate OBJ models.
-
[Solved?] [1.12] Make Illusioners spawn in mansions
The root of the repository should be the root directory of your mod, i.e. where build.gradle and the src directory are. See my mod and its .gitignore file for an example of the repository structure to use and the files to include.
-
Exception loading model for variant ERROR
The model file you've told Minecraft to use doesn't exist.
-
[1.12] setBlockState state.CycleProperty without resetting block NBT data (or update blockState/model based on NBT data)
Override TileEntity#shouldRefresh to return true only when the Block changes. This will allow the TileEntity to remain intact when the state changes but the Block is still the same.
-
[1.10.2] Open gui from custom entity
You need to pass the entity's ID (Entity#getEntityId) as one of the int arguments of EntityPlayer#openGUI. In your GUI handler, use World#getEntityByID to get the entity from its ID.
-
Add item cooldown like Ender Pearls
Everything is in the source code. World generation isn't handled by the Block class, it's handled by dedicated world generation classes. If you look for usages of Blocks.DIAMOND_ORE, you'll see that it's used in BiomeDecorator#decorate to create a WorldGenMinable instance. This is later used in BiomeDecorator#generateOres to generate veins of Diamond Ore.
-
[1.12] Help with registering entity into game
EntityRegistry.registerModEntity has nothing to do with rendering/textures. It belongs in common code, not client-only code. The registryName argument is a registry name, not a texture path. The entityName argument should include your mod ID. The mod argument is the instance of your @Mod class, but you're passing the RenderManager instance (which is still null in preInit) instead. This isn't a mod instance, so the game crashes with a NullPointerException when Forge tries to get the mod ID to write to the log.
-
[1.12] Help with registering entity into game
Do you actually know Java? You can't just type an arbitrary name like that, you need to pass the method a ResourceLocation and a String. The ResourceLocation must have your mod ID as the domain. If you don't specify a domain, it defaults to minecraft. Entity registration must happen on both physical sides, so it should be done in your @Mod class or a class called from it. Render registration must be done by calling RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit. This must happen only on the physical client, so it should be done in your client proxy or a client-only class called from it.
-
[1.12] Creating recipes with multiple results.
Create a class that extends the IRecipe class you're currently using and then override IRecipe#getRemainingItems to return the remaining item for each slot. Use ForgeHooks.defaultRecipeGetRemainingItems to get the default remaining items for every slot or ForgeHooks.getContainerItem to get the default remaining item for a single slot. Create a class that implements IRecipeFactory and parses your recipe from the provided JSON object. Specify this class in recipes/_factories.json. You can see the IRecipeFactory implementations for the Vanilla and Forge recipe classes in CraftingHelper.init. In your recipe file, set the type property to "<modid>:<recipe_name>", where <modid> is your mod ID and <recipe_name> is the name you specified in recipes/_factories.json.
-
[1.12] Help with registering entity into game
Passing null as an argument that isn't explicitly documented or annotated as nullable is a bad idea. You need to pass actual values for the registryName and entityName arguments. The registryName argument of EntityRegistry.registerModEntity is the registry name of the entity, which must be a unique name with your mod ID as the domain of the ResourceLocation and the entity's name as the path. The registry name is used as your entity's ID when it's being read from/written to NBT. The entityName argument of EntityRegistry.registerModEntity is a separate name for the entity, which should also be unique (i.e. you should include your mod ID in it). This is sometimes called the "old" name and is mainly used for translation/display purposes. I recommend using the registry name for this name, but it's not required to do so.
IPS spam blocked by CleanTalk.