American2050
Members-
Posts
553 -
Joined
Everything posted by American2050
-
So I was looking at Minecraft code on the furnace and I found this: if (active) { worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } else { worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, Blocks.FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } What's the idea behind setting the block state 2 times there?
-
Play sound no associated to player location
American2050 replied to American2050's topic in Modder Support
Yes the 2nd... Then it seems that you want to use a lower-level client-side sound method and avoid "positioned sound". Just feed a sound into the sound engine. Rather than looking at the minecart, which plays a continuous moving sound (position updated as minecart moves), you want something like the background music or GUI feedback sounds that are a purely local experience not heard by other players. Thanks, not sure where I will find that, but gonna look around on the Vanilla code. -
Play sound no associated to player location
American2050 replied to American2050's topic in Modder Support
Yes the 2nd, I'm trying to make the sound still playing, no matter where the player is, like when he dies for example, and he respawn, he should still be hearing the sound. Or even walking, when the sound gets triggered the way I'm calling it now it plays the sound at that position and stays there, I need it to "go" with the player. Thanks, sorry on the late response to this I got busy with other stuff. -
I'm not sure how to go around this but... Having 2 blocks positions, how can I know the distance between them? Thanks a lot. (Another solution to my problem could be, in what way I can make a circle of blocks from X given position)
-
I want to know how to access a the dimension int from an event like TickEvent.WorldTickEvent. Also, I have code that subscribes to this event, inside an Item, so I register that item on the EVENT_BUS. Is this correct to do?
-
Thanks a lot I thought the only flags possible were 1, 2 and 4, didn't realized there was flag 8 also.
-
So I see at some code in Minecraft, for example when a bucket picks up water or lava, that it uses flag 11 for the updates. What does 11 actually do there? I though flag 7 was the higher one.
-
Sorry that I answer myself, but playing around and looking at some code out there, I found out that: @SideOnly(Side.CLIENT) public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { Minecraft mc = Minecraft.getMinecraft(); mc.displayGuiScreen(new GuiHome(mc.currentScreen)); return new ActionResult(EnumActionResult.PASS, itemStack); } @SideOnly(Side.CLIENT) fixes the problem but....... Am supposed to use that? I have heard that shouldn't be used, so I believe I'm still doing something wrng somewhere.
-
I get an error about: Attempted to load class net/minecraft/client/gui/GuiScreen for invalid side SERVER I'm confuse while its happening, it's crashing on launch, not even when I use the item, I don't understand clearly why this happens. package com.mramericanmike.bqt.items; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumHand; import net.minecraft.world.World; import betterquesting.client.gui.GuiHome; import betterquesting.core.BetterQuesting; import com.mramericanmike.bqt.ModInfo; public class BQTItem extends Item { public BQTItem(String name){ this.maxStackSize = 1; this.setUnlocalizedName(ModInfo.MODID + ":" + name); this.setRegistryName(name); this.setCreativeTab(BetterQuesting.tabQuesting); } public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { if(world.isRemote) { Minecraft mc = Minecraft.getMinecraft(); mc.displayGuiScreen(new GuiHome(mc.currentScreen)); } return new ActionResult(EnumActionResult.PASS, itemStack); } } If I comment the line mc.displayGuiScreen(new GuiHome(mc.currentScreen)); server launchs, but I'm confuse on why this in happening or how to fix it.
-
I'm reading at: https://github.com/MinecraftForge/FML/wiki/FML-mod-information-file about the logoFile for the mcmod.info and I see this: I remember long time ago, like when I did some mod back in 1.6.4 I believe, that I read somewhere a recommended image dimension for the png to use there. Was that just some made up dimensions from somewhere, or there used to be a recommended one? What you guys usually use?
-
Eclipse Dependencies (From GitHub or GitHub zip)
American2050 replied to American2050's topic in Off-topic
I'm not I'm working on 1.10.2 I mention 1.7.10 as an example, this mod in question had an "Add-on" back in 1.7.10 that is not available in 1.10.2 so I wanted to code it my self. But I was not sure on how to import the mod into my workspace. Apparently, and I havent tested yet I have to use the deof jar file that the mod has available on Curse. So I will be testing that tomorrow probably -
Eclipse Dependencies (From GitHub or GitHub zip)
American2050 replied to American2050's topic in Off-topic
In the meanwhile there is no workaround? I have seen for 1.7.10 mods been made with this mod in question as dependencies. I will ask him that, or, if the mod is already uploaded for this somewhere and I'm missing it. Thanks. -
I'm not very familiar with setting up dependencies. I did once from the build.gradle set up a dependency using an url and some deobfCompile and runtime. The question: Is it possible to set up a dependency if the only thing I know from the mod I want to use is the GitHub repository and I downloaded the .zip for the source? Thanks in advance.
-
I'm making an item that when used it will act like a Firework. The problem I have is that I'm not sure how to make it also explode when it reaches top and what are all the variances I can "play" with. I understand I have to add that information to the itemstack the player is holding, but what are the options availables and the different values it can take? Thanks a lot.
-
[Solved][1.9+] Help getting item with metadata
American2050 replied to American2050's topic in Modder Support
And then I get the item from the created itemStack? Thanks, gonna try that -
I'm using getByNameOrId to get an item from a string, like this: Item myItem = Item.getByNameOrId("minecraft:iron_ingot"); My problem is, how can I do the same, but also consider a metadata, for example for modded items if I need to reference X mod that use ingots and metadatas for the different ones.
-
[1.9.4/1.10.2] Adding potion effect when a player eat food
American2050 replied to TheMulti's topic in Modder Support
And in that class you will need to overwrite the @Override onFoodEaten and have something kinda like this protected void onFoodEaten(ItemStack itemStack, World world, EntityPlayer player) { if (!world.isRemote) { player.addPotionEffect(new PotionEffect(Potion.getPotionById(3), 5400, 0)); } } Use the Potion ID of the effect you want and the duration/strenght you need. -
I'm not sure what would be the correct way to do this. Let's say I want to make things happen in game, after a player did something. For example, placing a block or destroying one or any other trigger, and once that happens, I want to have control of a timeline to for example, place more blocks or destroy others in a "timelapse" and not all at once. What would be the better way to do that, I'm really not sure where to start...
-
Confused about a value at EntityRegistry.registerModEntity
American2050 replied to American2050's topic in Modder Support
You use the new one instead, same method name, different parameters. Couldn't find out how to use the one that requieres a IRenderFactory but found out another way to register the renders. I wonder if this could work: RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); renderManager.entityRenderMap.put(EntityCopperChicken.class, new RenderCopperChicken(renderManager, new ModelCMDChicken(), 0.3F)); I didn't understand the other method and couldn't find any example yet. -
[FIXED] Custom Chickens wings problems
American2050 replied to American2050's topic in Modder Support
PS: Fixed, I went thru the code as you suggested and found what I was missing. public class RenderCopperChicken extends RenderLiving<EntityCopperChicken> { That fixed it, I was missing passing the EntityCopperChicken -
[FIXED] Custom Chickens wings problems
American2050 replied to American2050's topic in Modder Support
Well yes I went thru the code, but not sure what I'm missing. I guess the Vanilla chicken must be registering something else somewhere that I don't have for my chickens and that's why this is happening. I see the protected float handleRotationFloat but not sure what does is doing there. Probably nothing -
So I created a custom chicken, basically copying what Vanilla does for their chickens. The only problem I'm having, and I can't figure out why, is that my chickens when ingame, they are constantly rotation the wings, and not moving them just when on the air, like the Vanilla chickens would do. I see on the ModelChicken that the value they using is: this.rightWing.rotateAngleZ = ageInTicks; this.leftWing.rotateAngleZ = -ageInTicks; And I'm really not sure where those ageInTicks are coming from. What could be wrong in my case? Here is my Chicken Code: http://pastebin.com/ypZ1rAG5 And my Chicken render: http://pastebin.com/B1WE9kHZ
-
Confused about a value at EntityRegistry.registerModEntity
American2050 replied to American2050's topic in Modder Support
Got you PS: Do you know what should I use in 1.10 instead of the old RenderingRegistry.registerEntityRenderingHandler That's the last think I need to fix I believe. Thanks a lot -
So I have Created a new mob, kinda copying what a vanilla one does, the problem was that as soon as I was around 8 blocks away on the X or Z axis from the mob, it dissapear (don't render) anymore. EntityRegistry.registerModEntity(entityClass, entityName, ID, SinkMod.instance, 8, 1, true); Is what I had, now I have: EntityRegistry.registerModEntity(entityClass, entityName, ID, SinkMod.instance, 64, 1, true); I thought that number was how far the mob would react to me, like for example, if Im holding food for that mob, he was going to be able to see me from that far, but I guess I'm wrong. Is it ok to have 64 for a mob there? Should it be a higher number?