Jump to content

DanilaFE

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by DanilaFE

  1. Vanilla entity, being right-clicked, not attacked.
  2. Alright, this is my second post on this topic but it's asking a different question. Using entity.setCurrentItemOrArmor or entity.dropItem client-side only, surprisingly, only affects the client. However, because the Minecraft.getMinecraft().objectMouseOver.entityHit is client-only. Therefore, to successfully get an entity at which the player is looking, you can only be in a "remote" world, but from there, firing the two of the above methods doesn't do much, since it's not the server entities that are "dropping" an item. How do I make it so that right-clicking an entity that the player is looking at (a vanilla entity), will make it "drop" an item?
  3. Nope the that. Calling the method on a skeleton makes him drop as many bows as you use it. (Also, you can't pick them up?)
  4. So I know there is a method dropItem, but is there a way to, when the item drops, set the Players (or Entity's) held item to "air"?
  5. When I use an Item, I want it to spawn particles. It works clientside and on serverside but with a slight catch - the particles I try to spawn only appear to the player using the Item. How would I make sure that all players see them? Edit - oops forgot code @Override public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer player){ for(double x = -1; x < 1; x += .1){ for(double z = -1; z < 1; z += .1){ p_77659_2_.spawnParticle("portal", player.posX, player.posY - 1, player.posZ, x, -1 + (1 - -1) * random.nextDouble(), z); } } if(p_77659_2_.isRemote){ player.moveEntity(Minecraft.getMinecraft().objectMouseOver.blockX - player.posX, Minecraft.getMinecraft().objectMouseOver.blockY - player.posY + 3, Minecraft.getMinecraft().objectMouseOver.blockZ - player.posZ); } for(double x = -1; x < 1; x += .1){ for(double z = -1; z < 1; z += .1){ p_77659_2_.spawnParticle("portal", player.posX, player.posY - 1, player.posZ, x, -1 + (1 - -1) * random.nextDouble(), z); } } return p_77659_1_; } [code]
  6. Hello all! I'm having a bit trouble using the latest forge. I use Eclipse, of course. I want to look at minecraft's native source files. I have found something similar to what I need in Referenced Libraries > forgeBin, but they are all class files an I cannot view them. Am I looking in the wrong spot? Or what do I need to do to view them?
  7. I have a golem, which is supposed to be the farming golem. I would like to to wander around (already set THAT up) and all the wheat/potatoes/whatnot in the area to have bonemeal - like effects applied to them. That is it. Thanks in advance P.S. I did take a look at bonemeal, but it seems to be using a method that requires a player.
  8. I have a mob, which should be a Golem. Just like all the other golems, it is an EntityMonster. What i want, however, is for other snowmen NOT to attack him, and for him not despawn when the difficulty is set to peaceful. ~Using forge 1.6.4
  9. Well, I was thinking of using the pumpkin as the head for another golem, but clearly it doesn't work that way.
  10. Does that mean I can't do it without modifying base classes?
  11. I would like to make a new golem for the game, and I was wondering how to do it. Please help me, or at least point me to where the original game does it. Thanks in advance!
  12. You're not hijacking anything, friend. If you look at my earlier post it has all the code I used for the biome - just creating it and registering the biome adds it to the world (as far as it worked for me)Ignore the chunk and dimension providers, those are for the dimension. Look at FrozenBiome and the main class. It's also quite annoying because I have my own biome that is supposed to be dimension-specific spawn in the overworld. Happy modding!
  13. So pretend I want an entity to set another custom entity’s variable. I want there to be an entity called the necromancer, and he will make zombies follow him. I want each zombie to set a variable in the necromancer, so that I can find out how many zombies are connected. If I make a global variable zombieNumber, will it keep getting set to 0?
  14. EntityLivingBase#onDeath(DamageSource) I see a lot of those, but don’t understand how to use them. Can you get me one in context?
  15. Yeah, I was actually trying to do just that. Thanks!
  16. if(this.getHealth() < 40.0F){ this.setHealth(40.0F); } Say, I want to use the function above.Or maybe check Entity.ticksExisted. Where do I put it? Also, how do I include LivingDeathEvent or EntityLivingBase#onDeath(DamageSource) into my mob?
  17. Yeah, i went throught looking for missing “super”s and found that out. Thanks!
  18. How would I go about making 2 and 3? Could you explain it please?
  19. I have a few questions regarding a mod I'm making, and the mobs inside it. Question 1 Is there an event that fires on death of a mob? How can I access it? Question 2 How would I create a new entity at the location of the old one, when it dies? Question 3 How can I make an entity countdown, and at the end with a chance of, say, 1 in 3, spawn another mob/entity and destroy itself? Question 4 Is it possible for an entity to change into another entity when it’s RIGHT CLICKED Question 5 How would I add a custom task for a mob, for example sticking around another mob Question 6 How do I have mobs pick up blocks? Question 7 How do I have mobs place blocks? In a certain formation, like build a castle? That’s about it. Answer as many as you can.
  20. package mods.danilafe.frozenworld.mob; import mods.danilafe.frozenworld.FrozenWorld; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; import net.minecraft.world.World; public class MobNecromancer extends EntityMob{ public MobNecromancer(World par1World) { super(par1World); this.experienceValue = 0; } protected boolean isAIEnabled(){ return true; } public void applyEntityAttributes(){ super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.70D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(1.0D); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D); } protected void entityInit(){ this.getDataWatcher().addObject(12,Byte.valueOf((byte)0)); this.getDataWatcher().addObject(13,Byte.valueOf((byte)0)); this.getDataWatcher().addObject(14,Byte.valueOf((byte)0)); } protected void dropRareDrop(int par1){ switch(this.rand.nextInt(3)){ case 0: this.dropItem(FrozenWorld.WinterPlant.itemID, 1); } } public EnumCreatureAttribute getCreatureAttribute(){ return EnumCreatureAttribute.UNDEFINED; } public void onLivingUpdate(){ super.onLivingUpdate(); } } The thing is, in the stacktrace, when you click the java:12 ( the very LAST thing) it jumps me to " super(par1World);" Apparently all of the .setAttribute lines cause a crash EDIT WAIT I forgot to add the super. Noticed it myself. It still crashes; java.lang.reflect.InvocationTargetException 2013-12-14 16:39:32 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-12-14 16:39:32 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 2013-12-14 16:39:32 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 2013-12-14 16:39:32 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:205) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:175) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:81) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:153) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:434) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-12-14 16:39:32 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.DataWatcher.updateObject(DataWatcher.java:148) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.EntityLivingBase.setHealth(EntityLivingBase.java:829) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:194) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:85) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:40) 2013-12-14 16:39:32 [iNFO] [sTDERR] at net.minecraft.entity.monster.EntityMob.<init>(EntityMob.java:19) 2013-12-14 16:39:32 [iNFO] [sTDERR] at mods.danilafe.frozenworld.mob.MobNecromancer.<init>(MobNecromancer.java:12) 2013-12-14 16:39:32 [iNFO] [sTDERR] ... 20 more
  21. I've been watching a tutorial on youtube on how to make a mob. The code I made seems to have no errors, but when I try to use the new spawn egg I get an error. Game does not close. 2013-12-14 14:43:19 [WARNING] [Minecraft-Server] Skipping Entity with id 301 2013-12-14 14:43:20 [iNFO] [sTDERR] java.lang.reflect.InvocationTargetException 2013-12-14 14:43:20 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2013-12-14 14:43:20 [iNFO] [sTDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 2013-12-14 14:43:20 [iNFO] [sTDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 2013-12-14 14:43:20 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:205) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:175) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:81) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:153) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:434) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:556) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:691) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:587) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:484) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-12-14 14:43:20 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException 2013-12-14 14:43:20 [iNFO] [sTDERR] at mods.danilafe.frozenworld.mob.MobNecromancer.applyEntityAttributes(MobNecromancer.java:19) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.entity.EntityLivingBase.<init>(EntityLivingBase.java:193) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.entity.EntityLiving.<init>(EntityLiving.java:85) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.entity.EntityCreature.<init>(EntityCreature.java:40) 2013-12-14 14:43:20 [iNFO] [sTDERR] at net.minecraft.entity.monster.EntityMob.<init>(EntityMob.java:19) 2013-12-14 14:43:20 [iNFO] [sTDERR] at mods.danilafe.frozenworld.mob.MobNecromancer.<init>(MobNecromancer.java:12) 2013-12-14 14:43:20 [iNFO] [sTDERR] ... 20 more According to this, the game crashes because my main mob class (MobNecromancer) needs something passes down to it, a world. It is nowhere in the tutorial and nothing in his video crashes. What am I doing wrong?
  22. It works. Thanks, I now know how to do this stuff. This is also how minecraft Grass spreads, right? On random tick?
  23. Funny, just the biome height. Honestly, I wasn't even expecting the dimension to load, I have barely done anything in the chunk provider. Like seriously, five lines of code or so. Initiating the biome frozenBiome = new BiomeGenFrozen(45).setBiomeName("frozenBiome").setEnableSnow().setMinMaxHeight(0.3F, 1F).setTemperatureRainfall(0.3F, 0.5F); Dimension stuff DimensionManager.registerProviderType(FrozenDimensionID, FrozenProvider.class, false); DimensionManager.registerDimension(FrozenDimensionID, FrozenDimensionID); Biome class public BiomeGenFrozen(int id) { super(id); // TODO Auto-generated constructor stub this.topBlock = (byte)FrozenWorld.FrozenBiomeDirt.blockID; this.spawnableCaveCreatureList.removeAll(spawnableCaveCreatureList); this.spawnableMonsterList.removeAll(spawnableMonsterList); this.spawnableWaterCreatureList.removeAll(spawnableWaterCreatureList); this.spawnableCreatureList.removeAll(spawnableCreatureList); //Removing all mobs because I was going to replace them. I need all my mobs to do something similar //to the ones in the overworld, but a bit different so I will make new ones extending the originals. } } Provider public class FrozenProvider extends WorldProvider{ public void registerWorldChunkManager(){ this.worldChunkMgr = new WorldChunkManagerHell(FrozenWorld.frozenBiome, 0.2F, 1); this.dimensionId = FrozenWorld.FrozenDimensionID; } public IChunkProvider createChunkProvider(){ return new ChunkProviderFrozen(this.worldObj, this.worldObj.getSeed(), true); } public String getDimensionName() { // TODO Auto-generated method stub return "Frozen Dimension"; } } Chunk provider. As I said, very, very empty. I'm just barely learning how to do this. public class ChunkProviderFrozen implements IChunkProvider { private Random rand; private World worldobj; private final boolean mapFeaturesEnabled; private double[] NoiseArray; private double[] StoneNoiseArray = new double[256]; private MapGenBase caveGenerator = new MapGenCaves(); private MapGenScatteredFeature ScatteredFeatureGen = new MapGenScatteredFeature(); private BiomeGenBase[] biomesForGen; { caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, EventType.CAVE); ScatteredFeatureGen = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(ScatteredFeatureGen, EventType.SCATTERED_FEATURE); } public ChunkProviderFrozen(World worldObj, long seed, boolean b) { mapFeaturesEnabled = b; worldobj = worldObj; this.rand = new Random(seed); } public boolean chunkExists(int i, int j) { // TODO Auto-generated method stub return false; } public Chunk provideChunk(int i, int j) { // TODO Auto-generated method stub return null; } public Chunk loadChunk(int i, int j) { // TODO Auto-generated method stub return null; } public void populate(IChunkProvider ichunkprovider, int i, int j) { int k = i * 16; int l = j *16; BiomeGenBase biome = this.worldobj.getBiomeGenForCoords(k+16, l + 16); this.rand.setSeed(this.worldobj.getSeed()); long i1 = this.rand.nextLong() / 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L; this.rand.setSeed((long)i * i1 + j * j1); boolean flag = false; MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(ichunkprovider, worldobj, rand, i, j, flag)); if(mapFeaturesEnabled){ this.ScatteredFeatureGen.generateStructuresInChunk(worldobj, rand, i, j); } //int k1; //int l1; //int m1; //Unused code, WIP } public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate) { // TODO Auto-generated method stub return false; } public boolean unloadQueuedChunks() { // TODO Auto-generated method stub return false; } public boolean canSave() { // TODO Auto-generated method stub return false; } public String makeString() { // TODO Auto-generated method stub return null; } public List getPossibleCreatures(EnumCreatureType enumcreaturetype, int i, int j, int k) { // TODO Auto-generated method stub return null; } public ChunkPosition findClosestStructure(World world, String s, int i, int j, int k) { // TODO Auto-generated method stub return null; } public int getLoadedChunkCount() { // TODO Auto-generated method stub return 0; } public void recreateStructures(int i, int j) { // TODO Auto-generated method stub } public void saveExtraData() { // TODO Auto-generated method stub } }
  24. Actually, I kinda figured it out. The biome had so much water because the biome height was far below sea level. I brought it up a bit and it works.
  25. I want it to be more like a forest biome, flat with less water. How would I do that?
×
×
  • Create New...

Important Information

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