American2050
Members-
Posts
553 -
Joined
Everything posted by American2050
-
Is there a way to make an item "Durable" like, it gets destroyed after a certain amount of time, no matter if it's on the players inventory, or in a chest, or wherever... Thanks a lot for any help.
-
The block at the wheels, I understand you mean under the wheel, I think you can use Block.isNormalCube and check if block is water still or running, for that? Now the problem is you say you need to check if it has 1 block above it, which wont be true as your wheel is above it. I imagine you first need to determine the direction the car is going and check 1 block above the previous block in that direction?
-
[1.7.10] On Item right click - Get block and distance
American2050 replied to American2050's topic in Modder Support
Ohhh then I think think it will work for what I need. I think the Wither has something that "aims" to blocks at any distance. Not sure if that can be applied to a player when right clicking an item Maybe some other method... -
[1.7.10] On Item right click - Get block and distance
American2050 replied to American2050's topic in Modder Support
Thanks diesieben07 gonna take a look at that one I thought that only worked if the block was "in range" like the range when you place a block, I didn't know you can actually get the block and coordinates, no matter what the distance is Thanks one again. -
Is there some method to get the Block, coordinates and distance form player when we right click an item? For example on a Pickaxe when a player right clicks it I need to know what block is he pointing at, the coordinates and the distance to that block from the player. Not sure if is there some Vanilla item with this behavior I can take a look at. Thanks a lot for any help
-
[1.7.10] Does adding commands to a Mod requires a new World?
American2050 replied to American2050's topic in Modder Support
I think I did it wrong from the beginning I really don't need a Server Command, but just a command to show player some info -
So I followed this Tutorial on how to add commands on my mod. http://www.minecraftforge.net/wiki/Server_Command However when I replace my old mod in my testing environment and try to open an already generated world, it just hangs out on the Loading world. I can create new worlds, and when trying on Eclipse it works ok. Is this an expected behavior or I'm missing something?
-
In my case I dont have the "Stacks moving" on that method. I have "detectAndSendChanges" on the Container and is been used to update the progress of the bars on the GUI The stacks I have them on the TileEntity of the block. You can take a look on the TileEntity for the furnace on Vanilla code, that will give you an idea for sure.
-
[1.7.10] Place Mob Spawner other than pigs
American2050 replied to American2050's topic in Modder Support
Thanks. Found it under: tileentitymobspawner.func_145881_a().setEntityName("Zombie"); -
I was trying to place in world a Mob spawner, but I always get the Pig ones. I found a guide that explains how to do it, but, I'm either doing something wrong, or this method no longer works on 1.7.10 http://www.minecraftforge.net/wiki/Mob_Spawners SchematicHelper.setBlock(world, player, x + 2, y + 6, z + 2, mobSpawner, 0); TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner)world.getTileEntity(x + 2, y + 6, z + 2); tileentitymobspawner.getSpawnerLogic().setMobID("Zombie"); The method getSpawnerLogic() is undefined for the type TileEntityMobSpawner That's the error I get.
-
[1.7.10] Spawn entity riding another entity
American2050 replied to American2050's topic in Modder Support
Thanks a lot man Now it's working perfect and I'm so happy it doesn't involve working with NBTTags Once again, thanks for the great help as usual. -
[1.7.10] Spawn entity riding another entity
American2050 replied to American2050's topic in Modder Support
Thanks diesieben07. So apparently it was much easier then what I thought. But I still have a problem. Spawning other mobs I had no problem, but when I spawn this ones, they don't "render" correctly till I relog. The code for example is: Entity entityX1; Entity entityX2; //Bat entityX1 = new EntityBat(world); entityX1.setPosition(x+0.5, y+1, z+0.5); //Creeper entityX2 = new EntityCreeper(world); //entityX2.setPosition(x+0.5, y+1, z+0.5); entityX2.mountEntity(entityX1); world.spawnEntityInWorld(entityX1); The Bats spawn, but you can't see the Creeper, however, when you relog, you can see them. -
I'm not sure how to do this. I have already a block that will spawn entities when someone breaks it. Now I want to make it so it also spawn entities riding other entities, like for example a Slime riding another Slime. I only know it's possible, and I think it's done with NBT (Topic that I really don't understand much how to handle) Does anyone has some example code on how to spawn an entity riding another entity. And also, is there a limitation to, like what combinations would works and what no? Thanks a lot in advance.
-
Why? Yes. You need to manually loop through all enchantments and check their "name" field (you need reflection since it's protected) in 1.7. It will, if you use the format "modid:item". Thanks diesieben07 I will see if I understand what you mean about "reflection" and that, really not sure how that work. Also, if I use modid:item wont work, what would be a better/correct way to do it? That's why I titled the post like this, I'm really lost here trying to make this from scratch, but I'm not sure I'm going the right way, or at least a way where I can finally achieve what I want. Someone may suggest, hey, you can do this way easier like this or that. I was thinking on having the txt file with something like: dropX = new ItemStack(Items.wooden_sword,1,0);dropX.addEnchantment(Enchantment.looting, 10);dropX.setStackDisplayName("Use Less"); And maybe import that somehow?
-
Hi guys, I want to add items ingame (as drops) from a .txt file where you are able to configure the item, the enchantments for it and a custom name. So far I have everything figured out, but not the custom enchantment part. The .txt file looks like this {item:minecraft:potato,1,0 - enchantment1:baneOfArthropods,1 - enchantment2:looting,2 - enchantment3:knockback,3 - enchantment4:featherFalling,4 - enchantment5:infinity,5 - name:Epic Potato 5} Basically what I'm doing right now is, reading from 'item:' to ' - enchantment1' to get the item data and then I take that info and separate it in 3, leaving me with minecraft:potato, 1 and 0 (As item, itemQuantity, itemMeta) Similar with the custom name, reading from 'name:' to the end of the line looking for that '}' My problem is with the enchantments, I have already the code ready to recognize if there is only 1 enchantment, 2, 3, 4 or 5 and I get each of them again, for example enchatment1: "baneOfArthropods" enchatment1Level: 1 My problem is. How do I add that to the item if what I have is: Item finalItem = GameData.getItemRegistry().getObject(item); dropX = new ItemStack(finalItem); dropX.addEnchantment(Enchantment. XXX , enchantment1Level); Where I have the XXX I don't know how to "convert" enchatment1 that contains "baneOfArthropods" into something that would work there. If you want to take look at the whole code let me know. Thanks a lot for any help
-
Hello guys, I'm kinda confuse here, I have made a Custom Mob, and I want it to drop always certain item in a quantity of 1 So I have this on the code @Override protected Item getDropItem() { return ModItems.apple_ext; } But I think, this code actually will drop this item, at a chance, right? If so, how should I make it.
-
I never think about this in the past, but now that I updated Java to version 8_51 (I think I had 8_40 before) when I'm building the .jar I get a Warning like: I shouldn't update? When I check on Eclipse for that file, I don't see Eclipse underlining any error, the only Java import I have there is java.util.List Is there any "Rule" on what version of Java to use when coding for the different Minecraft Versions? PS: This mod is 1.7.10 This is the config I have on the Compile settings
-
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
Thanks coolAlias, I was totally missing that I actually had to use event.entity.writeToNBT(tag); I thought I just read from it, didn't know I had to use the write first in order to access the information Everything working now ***** Just a quick note, I had to use tag.func_150296_c() instead of tag.getKeySet() this last one wasn't present, but looking at the source, I figured out that func_150296_c was going to work (Got lucky on that one I guess) -
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
Thanks coolAlias, I will give a try to your method. Also will ask about the method used to the Mod Developer on Monday. Thanks for the help and patience. -
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
Then I'm lost. I thought I was getting the NBT with that I'm way confuse here. I'll have to look around and see if I find any good tutorial about the NBT and see if I figure out how to apply it in this case. -
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
Thanks. Yes I will contact him, apparently thats what I'm doing, so, I'm either doing something wrong, or trying to read data that isn't there, that's why I first wanted to know if there is a method to dump everything inside the NBT to know exactly what is stored on it. NBTTagCompound EntityNBT; int EntitySpecie; EntityNBT = event.entityLiving.getEntityData(); EntitySpecie = EntityNBT.getInteger("Subspecies"); MyMod.log("Entity Specie: "+EntitySpecie); I bet I'm missing something, or as I said, maybe I'm trying to read something that isn't there. Gonna do some testing and try with event.entity.getEntityData(); instead of entityLiving -
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
I was told by the developer of the Mod of the entity I'm trying to identify that: But I never worked with NBT Tags, so I'm not sure how to get that info on the LivingDeathEvent. -
[1.7.10] Reading all data from NBT on Entities
American2050 replied to American2050's topic in Modder Support
I am confuse. I don't need to write to the NBT, I just need to know everything that the entity that died had on his NBT So I have "public void onLivingDeath(LivingDeathEvent event)" and when I do event.entityLiving I can see there is event.entityLiving.readFromNBT() but I don't know how to use it -
Hi guys, I'm not familiar with NBT Data at all. What I need is to get all the Data stored on Entities when they die. What I'm trying to achieve is to identify when an specific mob dies. So for example, for a Wither I have something like. public static final Class NETHER_BOSS = (Class) EntityList.stringToClassMapping.get("WitherBoss"); event.entityLiving.getClass().equals(EventHandler.NETHER_BOSS) Back to the NBT problem, how can I get all the NBT data stored on the entities? And also, would it be posible somehow to "Dump" into the console or a file (Kinda like NEI does the Data Dumps for items or blocks in game) but for all the entities with their registered string names? So that way I can use the EntityList.stringToClassMapping.get Thanks a lot, hope I'm not confusing to much with what I'm trying to do