• 1

    posted a message on Tile Entity inventory resets on world reload.

    Are you certain the ItemStack[] is empty? I mean, maybe the server knows the items but the client doesn't, and the client is the one with the GUI. Add some printouts to be sure.

    Posted in: Modification Development
  • 1

    posted a message on How do I make a player specific variable or an item that will never dissapear, even on player death or attempted dropping

    First, properly learn Java. "Hacking" MCreator to do this will only result in horrible, messy, disastrous code.


    Second, always state which version of Minecraft you are modding for. In 1.7.10 and 1.8.x, use IEntityExtendedProperties to save a value to a specific player. In 1.9 and beyond, use the Capabilities system. You do not have to give the player an item to use these systems, so don't worry about that.


    Third, post code on Pastebin or Gist and link to it here instead of posting directly on the forums. Make sure it has proper formatting and the .java extension for proper syntax highlighting.


    Fourth, learn how to work with Forge before you try this. You will just get confused if you dive into modding too fast. Once you know Java, practice by making basic blocks, items, event handlers, etc. until you know how to navigate the IDE to find what you need.

    Posted in: Modification Development
  • 1

    posted a message on Get the of a block you are looking at.
    Quote from jit8»

    There is no sideHit in my objectMouseOver :/

    Um...
    Well...
    I'm pretty sure there is...

    open the MovingObjectPosition class and search for anything that returns an EnumFacing. Or any variable that is of type EnumFacing.
    objectMouseOver is a MovingObjectPosition, correct?
    Posted in: Modification Development
  • 1

    posted a message on Where my texture at?

    ModelLoader.setCustomModelResourceLocation should be called from preInit, not init.

    Posted in: Modification Development
  • 1

    posted a message on Get the of a block you are looking at.
    Quote from jit8»

    i get what you mean but i don't know how to use it doe :/ like, how can i check it?



    Exactly like you would check any equality:

    if(objectMouseOver.sideHit == EnumFacing.WEST)

    Or, since you want any horizontal to work:

    if(objectMouseOver.sideHit != EnumFacing.UP && objectMouseOver.sideHit != EnumFacing.DOWN)
    Posted in: Modification Development
  • 1

    posted a message on Get the of a block you are looking at.

    First off, if you insist on using the Minecraft class (mc) put everything inside a statement if(world.isRemote) or something similar. You should be able to access the working world object without the Minecraft class, or it kind of defeats the purpose.


    Second, I think the objectMouseOver is a RayTrace or MovingObjectPosition object, correct? Just check that objectMouseOver.sideHit is equal to EnumFacing.WEST

    To have your code run if it is any horizontal side, make sure it is not equal to EnumFacing.UP or EnumFacing.DOWN.

    Or, check that EnumFacing.HORIZONTAL contains the sideHit.

    Posted in: Modification Development
  • 1

    posted a message on Get the of a block you are looking at.
    Quote from Alpvax»

    There is actually an EnumSet EnumFacing.HORIZONTAL, just check that the hit side is in that set.


    Your code will not work on a server, as you are using the Minecraft class, which only exists on the client. That won't be a problem if you just want it to affect rendering or show a message in the player's chat.


    Look at the code that calls Block.onRightClick (I don't think that is the correct method name, but you should be able to work out which method I mean).

    See where the EnumFacing parameter comes from.


    Block#onActivated is what you are thinking of :D
    Posted in: Modification Development
  • 1

    posted a message on Block particles not showing up correctly

    Add the "particle" tag with your texture

    {
        "parent": "block/cube_all",
        "textures": {
            "all": "minecraft:blocks/dirt",
            "particle": "minecraft:blocks/dirt"
        }
    }
    Posted in: Modification Development
  • 1

    posted a message on [Help] Adding Custom Structures To World. Which Method Is Better?

    I have a tutorial on Complex Structure Generation that may be useful depending on the size of your structure. It requires an array of "relative" locations that are passed into a helper method -- that helper method makes each BlockPos for you.

    Either way, you will end up creating a lot of temporary BlockPos instances... there's not really a way to avoid that, so don't worry too much.


    Each chunk can only handle around 1000 block updates per second, so if you set more than a hundred blocks you should consider using a Timer. That is, generate segments of your structure every few hundred milliseconds, which gives the game time to update the client.

    Posted in: Modification Development
  • 1

    posted a message on Crash when listing entities in an area
    Quote from Melonslise»

    What do you mean field boundingbox is public? What field? How do I fix this?


    I think you can use player.boundingBox . If it complains about "not visible" then boundingBox is not public, but I think it will work.

    Posted in: Modification Development
  • To post a comment, please .