Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/08/19 in all areas

  1. Override Entity#applyOrientationToEntity and do whatever you need to the player's rotation there.
    1 point
  2. You might also want to look into the Looking Glass mod. I don't know if it has been updated recently (XCompWiz has been pretty busy), but you might be able to examine it to see how it works. The whole point of Looking Glass was to provide a mod-friendly way of being able to render views of any location in Minecraft, including other dimensions.
    1 point
  3. In simple words, World#isRemote returns true on the logical client side and false on the logical server side. In your case, you want the code to run on the server side, thus you should check if World#isRemote is false. To learn more on sides, check out: https://mcforge.readthedocs.io/en/latest/concepts/sides/ The page also covers World#isRemote.
    1 point
  4. Remove FrostCraft and perhaps report to the author of the mod. EDIT: Just realized this is 1.7.10. 1.7.10 is no long supported on this forum; it is so old that people don't know how to help you with it.
    1 point
  5. EntityPlayerSP is not EntityPlayerMP. You cannot cast from one to another. if (player.world.isRemote) { EntityPlayerMP entityPlayerMP = (EntityPlayerMP) player; //Game crashes here can't cast EntityPlayerSP to EntityPlayerMP The if statement here will only be true on the client side, thus the player is SP, not MP. Are you sure you didn't meant: if (!player.world.isRemote) ?
    1 point
  6. I'm with you. I have really struggled to make that jump from using tutorials to do basic stuff to combing through code from Minecraft, Forge, and other mods to try and understand their examples and come up with something that's kinda similar but unique. Every inch I've gained has been tough. You implement ICapabilityProvider to "serve up" your inventory (an ItemStackHandler instance) when it's being asked for. You can probably copy my BasketInventoryProvider almost exactly, except replacing the ItemStackHandlerBasket with Forge's built-in ItemStackHandler. As you can see in my notes on that class, I ended up having to implement ICapabilitySerializable in order to get my inventory to persist in various situations. ICapabilitySerializable is an extension of ICapabilityProvider that, in addition to providing the inventory when asked for, also writes and reads the inventory itself into your ItemStack's NBT. At that point you just return an instance of your ICapabilityProvider (or ICapabilitySerializable) from your Item's initCapabilities method, and you're off to the races. It doesn't have to be registered with Forge in any special way beyond simply returning it from initCapabilities (I think initCapabilities is a method that was injected into the Item class by Forge for the very purpose of attaching capabilities to items—initCapabilities is called from the ItemStack constructor when your item is being instantiated in an inventory). If you want to have a GUI on your item, there's more to it. For that you need the GUI itself plus a GuiProvider. There are examples of those in my mod, as well. I used my item's onItemRightClick method to call up the GUI.
    1 point
  7. this is the minecraft source code and minecraft forge source code. Ctrl+space list all field and methods in a class public static void main(string args[]){ System.out. } hovering over an object will link to its class clicking on it takes you to its source code. right click on an object and click type hierarchy btw this is all of the types that have a registry call type the docks are not the best. they don't tell you every thing you may need to dig this should help and i think this is what you are look for maybe? and there is out line is on the side looks like this ? this is a piece of code from EntityType<T> class at first I did not now how to register entitys but this gave me a start point to finger it out. this is to just get you thinking. public static final EntityType<EntityTippedArrow> ARROW = register("arrow", EntityType.Builder.create(EntityTippedArrow.class, EntityTippedArrow::new)); public static final EntityType<EntityBat> BAT = register("bat", EntityType.Builder.create(EntityBat.class, EntityBat::new)); you now have a reference to just about every thing in terms of docs.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.