Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral


  • Rank
    Creeper Killer


  • Gender
  • URL
  • Location
  • Personal Text
  1. Hey there, I'm trying to setup a basic keybinding, but I can't seem to get the event to fire. Here's my code for subscribing to the event: @Mod.EventBusSubscriber public class ModKeyInputs { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if (ModKeyBindings.OPEN_DIVINE_FAVOUR_RELATIONSHIP.isPressed()) { Minecraft.getInstance().displayGuiScreen(new DivineFavourRelationshipsScreen(Minecraft.getInstance().player)); } } } Now I've put a breakpoint in the method there at the start, and I can never get
  2. Didn't realise doing both was bad, thought it was required. I've commented out the MOD_EVENT_BUS registration and it worked like a charm. Thanks!
  3. Hey, recently upgraded my mod from 1.15 to 1.16 and I previously had a subscription to RenderGameOverlayEvent.Post however since upgrading I now get the following exception when starting the game: Method public static void com.lickbread.mesoamericamythology.registry.event.ModGuiHandler.renderGameOverlay(net.minecraftforge.client.event.RenderGameOverlayEvent$Post) has @SubscribeEvent annotation, but takes an argument that is not a subtype of the base type interface net.minecraftforge.fml.event.lifecycle.IModBusEvent: class net.minecraftforge.client.event.RenderGameOverlayEvent$Post
  4. Alright worked it out. I'm pretty dumb. If you're in creative mode the item that gets used is a copy of the original item (to prevent durability loss and the like I suppose). In survival it works fine. So I guess I just need to replace the actual item when in creative.
  5. Hi there, I have an item, that on clicked on an entity (called in itemInteractionForEntity), it would attempt to add some data to the stacks tag. When debugging, I can see that the method is called and the stack nbt is updated, but it seems like it's not persisted anywhere outside of that method call. Subsequent calls to that method show that the stack tag is empty. I've done some fiddling around, but I'm really not sure what's going on. Here's my code for the method call: public boolean itemInteractionForEntity(ItemStack stack, PlayerEntity playerIn, Liv
  6. Hi there, As the title states I have a TileEntityRenderer that displays a floating, rotating item or block, something I'd like to do is also render the shadow of the item I'm displaying on the block below (which would be the block that the TileEntityRenderer is for). Looking through the base code, but struggling to find a usage I could work with. I see the following, but it and things attached to it are private. renderShadow(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, Entity entityIn, float weightIn, float partialTicks, IWorldReader wor
  7. Thanks for that. I ended up just registering a block for it and loading the model like normal.
  8. It's for a TileEntityRenderer. I'd like to animate the position of this extra model. Would I use modelLoader.getModelOrMissing() for this purpose? I suppose something I could do is create "nothing" blocks that use the model and then load that using block state; but I'm not sure if that's a good way to go about it.
  9. Hi there, I know I can load an existing block model like: BlockRendererDispatcher blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher(); IBakedModel bakedModel = blockRenderer.getBlockModelShapes().getModel(state); IModelData data = bakedModel.getModelData(world, pos, state, ModelDataManager.getModelData(world, pos)); blockRenderer.getBlockModelRenderer().renderModel(world, bakedModel, state, pos, matrixStackIn, bufferIn.getBuffer(Atlases.getSolidBlockType()), false, new Random(), 42, combinedOverlayIn, data); What I'
  10. Thanks worked! Code below for those that would like it: @Mod.EventBusSubscriber public class ModAtlasTextures { @SubscribeEvent public static void onTextureStitchEvent(TextureStitchEvent.Pre event) { if (event.getMap().getTextureLocation() == LOCATION_BLOCKS_TEXTURE) { event.addSprite(ModShieldItemStackTileEntityRenderer.LOCATION_SHIELD_BASE_NO_PATTERN); } } }
  11. Hi there, I've been adding a custom shield to my mod. It's working fine and all, however I can't seem to get my custom textures working. I believe the problem lies in that the default way the shield is rendered uses materials that take in an AtlasTexture. Now I've tried using the same texture altas sprite that the ShieldModel, which is `AtlasTexture.LOCATION_BLOCKS_TEXTURE`, but that doesn't work. I'm going to keep searching, but asking here if someone knows the answer. Is there an existing AtlasTexture that I can use that will have my texture baked into it?
  12. To test I would dump the capability in the logs each time writeNBT and readNBT was called. I could see that as I did actions that modified the capability the capability did indeed change. So when I created a relationship or added divine favour or met a god, it would be saved correctly in the capability attached to the player. However if I saved and quit, then reloaded the world, the capability was reset.
  13. Hmm, what do you mean? All data only exists on server side, and interactions/changes to capability only happen on the server side. What part isn't happening on the server side? Are you saying the client side also needs the data?
  14. As the title states, I've added a capability to the player and registered it. I can interact with it, and it's updated as normal while I play, but as soon as the player leaves the game the capability and rejoins, their capability is reset to the default - which to me seems like it's not persisting the change. I can also confirm that the attachCapabilities method is being called. I can see that the writeNBT method is being called when I open the pause menu, and it has the right data in it. But when I log in, the readNBT is always displaying null. I'm not sure what I'm doing wrong -
  15. What you want sounds like the capability system: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.