Jump to content

MCRaichu

Members
  • Posts

    63
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    Error, Edit, Compile, Repeat.

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MCRaichu's Achievements

Stone Miner

Stone Miner (3/8)

3

Reputation

  1. Is that safe? the ID is of type UUID (128bit) and casting it to int (32bit) could cause some trouble, right? EDIT: forget it. I used entityUniqueID not getEntityId() [SOLVED]
  2. okay, so I explained it wrong. after I called openGui from EntityPlayer /** * Opens a GUI with this player, uses FML's IGuiHandler system. * Allows for extension by modders. * * @param mod The mod trying to open a GUI * @param modGuiId GUI ID * @param world Current World * @param x Passed directly to IGuiHandler, data meaningless Typically world X position * @param y Passed directly to IGuiHandler, data meaningless Typically world Y position * @param z Passed directly to IGuiHandler, data meaningless Typically world Z position */ public void openGui(Object mod, int modGuiId, World world, int x, int y, int z) { net.minecraftforge.fml.common.network.internal.FMLNetworkHandler.openGui(this, mod, modGuiId, world, x, y, z); } this is handled on client and server side (getClientGuiElement, getServerGuiElement). How can I access the interacted entity at that point? Which I need to get the inventory.
  3. Hi, I created a custom entity with an inventory (basically like a horse). But I'm struggling opening the gui since openGui only takes the player as an input and I don't know how to get the entity I'm interacting with. Any ideas? Thanks in advance, MCRaichu
  4. Hi, I want to create an item that does not slow down the player while using it, for example a bow allowing to move at normal speed while charging up. My problem is, I can't find where the player is slowed during item usage. Has anyone done this before and figured out a way to do it? Anything helps. Thanks in advance, McRaichu
  5. Looping over all Renderes in PostInit makes sence. I don't have time until sunday to give it a try. May have more question on monday meaning I may bother you again . Thanks again.
  6. Wouldn't that require that I know all models when my mod is loaded? That would make it incompatible with other mods (their entities), right? In your experience, what would be your approach to achieve a kind of visual feedback to differentiate between affected entities and unaffected ones. Maybe I should consider a different idea. I just don't like the particle effects of the potions, I wanted something more solid/bigger.
  7. okay. to answer all you questions. 1.: the code i posted is in the onEvent(RenderLivingEvent.Post<EntityLivingBase> event) function as shown in Post 4 2.: As mentioned in the first post, I want to add something to any entity that is under a potioneffect. The code I posted, with creeper and the box I add, is just for testing. 3.: Using the model makes it easier to adjust the position of what i add, but with a global model that's not possible.
  8. No, the creeper (just a placeholder in my example) should render as normal but the addition, here the "box", should render with a texture of my choice. Currently the box renders with the creeper-texture.
  9. I may have to ask you to get a bit more specific. My understanding was to simply change the model and assign new texture (straight forward). EntityLivingBase entity = event.getEntity(); RenderLivingBase renderer = event.getRenderer(); ModelBase model = renderer.getMainModel(); if(entity instanceof EntityCreeper) { ModelCreeper mr = (ModelCreeper)model; renderer.bindTexture(new ResourceLocation(Gunny.MODID+ ":textures/items/models/vss_item.png")); ModelRenderer box = new ModelRenderer(model, 0, 16); box.addBox(0.0F, -20.0F, 0.0F, 10, 2, 10); mr.body.addChild(box); } Maybe I don't get when the event is called and what the difference of Pre and Post are in this case. Edit: Currently the original creeper-texture is still used.
  10. @SubscribeEvent public void onEvent(RenderLivingEvent.Post<EntityLivingBase> event) { EntityLivingBase entity = event.getEntity(); RenderLivingBase renderer = event.getRenderer(); ModelBase model = renderer.getMainModel(); if(entity instanceof EntityCreeper) { ModelCreeper mr = (ModelCreeper)model; ModelRenderer box = new ModelRenderer(model, 0, 16); box.addBox(0.0F, 0.0F, 0.0F, 10, 2, 10); mr.body.addChild(box); } } I did a small test-code. I love the idea of adding to the model because the added parts move with the entity. But the problem is, I have no idea how to set a different texture for my added parts. is it even possible?
  11. Hi everyone, I want to add a model I have made to entities while they are under a potioneffect. Currently I don't know where to start . Has anyone tried this before? Any tips where to start? For better understanding, I want to create a crystallization disease that creates tiny crystals on the infected entity. Thanks in advance, McRaichu
  12. That actually brings up another question. Since I want to change the model while the player is using the inventory/gui should I set a NBT flag to differentiate between both states? or is there a better soplution? I ask because of so the itemstack needs to know if gui ist open, right?
  13. Thanks for the quick answer. Since I only have two states the first the solution with ItemMeshDefinition makes the most sence. I have seen the ICustomModelLoader in ImmersiveEngineering and I definitly won't do that. Do you have a good example for ItemMeshDefinition ?
  14. okay. my json file (location: assets.gunny.blockstates) { "forge_marker": 1, "defaults": { "model": "gunny:b95_item.obj" }, "variants": { "inventory": [ { "transform": { "thirdperson_lefthand": { "rotation": [ { "x": 0 }, { "y": 0 }, { "z": 0 } ], "translation": [ 0.1, -0.1, 0.5 ], "scale": 0.15 }, "thirdperson_righthand": { "rotation": [ { "x": 0 }, { "y": 270 }, { "z": 0 } ], "translation": [ 0.1, 0.05, 0.2 ], "scale": 0.25 }, "gui": { "rotation": [ { "x": 45 }, { "y": 45 }, { "z": -45 } ], "translation": [ 0.2, -0.15, 0 ], "scale": 0.15 }, "firstperson_righthand": { "rotation": [ { "x": 0 }, { "y": 250 }, { "z": 0 } ], "translation": [ 0.0, 0.15, 0.0 ], "scale": 0.5 }, "firstperson_lefthand": { "rotation": [ { "x": 180 }, { "y": 180 }, { "z": 170 } ], "translation": [ 0, -0.1, 0 ], "scale": 0.5 }, "ground": { "rotation": [ { "x": 45 }, { "y": 0 }, { "z": 0 } ], "scale": 0.2 } } } ] }, "overrides": [ { "predicate": { "loading": 1 }, "model": "gunny:b95_open.obj" } ] } Item: public class B95 extends ItemInternalStorage { final int gun_cooldown = 20; public B95(String name) { super(name, 1); this.setHasSubtypes(true); this.setMaxDamage(0); this.setCreativeTab(Gunny.tabGunny); this.addPropertyOverride(new ResourceLocation("loading"), new IItemPropertyGetter() { @SideOnly(Side.CLIENT) public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { System.out.println("loading"); return 0.0F; } }); } ... } Registration (domain is already added): ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(Gunny.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory")); Anything else needed, just let me know.
×
×
  • Create New...

Important Information

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