Jump to content

code4240

Members
  • Posts

    18
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Location
    The Evergreen State
  • Personal Text
    I am they, they is me.

code4240's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Well, I solved it, sorta. By implementing the new AI system, I was able to overcome the max speed, as the ai system doesn't have a max. Of course, it has a bunch of movement bugs now, but that's for another time.
  2. I'm trying to CHANGE the maximum speed. I thought I had made that clear already.
  3. Are you talking about the chunks that look like this? //this.moveSpeed = 0.28F; this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.28D); //this.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 10, 0)); Yep, those bits. Unless I'm missing something, those are all below the max speed, so this doesn't help me.
  4. Also, this: https://github.com/code4240/DarwinMod/blob/master/mod/Minecraft/src/code4240/alien/mob/EntityDarwinNeutral.java
  5. No, I have not touched those. All I know about those is that I don't have the AI set up, and setting AI to true paralyzes it. also, trying to change the landMovementFactor gives an error because that variable is protected.
  6. Are you talking about the chunks that look like this? //this.moveSpeed = 0.28F; this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.28D); //this.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 10, 0));
  7. I'm using such a huge value to see if it does anything.
  8. public static double speedModifier = 60D; private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", speedModifier, 0)).setSaved(false); Like I said, this works when the the regular speed is below the max. It's just that it won't improve it beyond the max. EntityRegistry.registerModEntity(EntityArrowtongue.class, "arrowtongue.entity", arrowtongueID, mod, 80, 1, true);
  9. I'm trying to make my mob move much faster when chasing an entity. However, it seems that mobs have a speed limit that is somewhere around 10 - 30. I've tried every modification I can think of, yet nothing ever makes it go faster than an average sprinting mob. Not even setting the movementSpeed attribute to 6000 will have a noticeable effect. Here is the code I'm currently using: public void onLivingUpdate() { super.onLivingUpdate(); if (this.lastEntityToAttack != this.entityToAttack) { AttributeInstance attributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); attributeinstance.removeModifier(attackingSpeedBoostModifier); this.setSprinting(false); if (this.entityToAttack != null) { attributeinstance.applyModifier(attackingSpeedBoostModifier); this.setSprinting(true); } } this.lastEntityToAttack = this.entityToAttack; } Also, just in case you doubt my ability to apply basic attributes, here's that code too: @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); // Max Health - default 20.0D - min 0.0D - max Double.MAX_VALUE this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(50.0D); // Knockback Resistance - default 0.0D - min 0.0D - max 1.0D this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setAttribute(0.5D); // Movement Speed this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6D); // Attack Damage - default 2.0D - min 0.0D - max Doubt.MAX_VALUE this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(10.0D); } (I know this isn't a problem with the attributes themselves because the other ones (health, damage, knockback) work) The speed modifier is copied from EntityEnderman. I know it works because it makes the mob move faster than their movementSpeed attribute if that attribute it is below the max speed. I've been digging through the files for about a week trying to find whatever is causing the movement limit, but I've failed to find anything. https://github.com/code4240/DarwinMod/blob/master/mod/Minecraft/src/code4240/alien/mob/EntityDarwinNeutral.java
  10. I figured it was something like that, it's just that math is my worst skill and looking at math in general fries my brain. The hardest part of it was dealing with the fact that sunrise range is (22000 -> 0 -> 500). For anyone looking to do this, here's what I did: @Override public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { long time = this.worldObj.getWorldTime(); float red = 1; float green = 1; // Green and blue use the same values in this instance // DAY if (time >= 500 && time <= 11500) { return this.worldObj.getWorldVec3Pool().getVecFromPool(0.6, 0.4, 0.4); } // NIGHT else if (time >= 14000 && time <= 22000) { return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0); } else { //SUNRISE if (time > 22000 || time < 500) { // CREATE RANGE OF 1 - 2499 if (time > 22000) { time = (time - 500) - 21500; // 1 -> 1999 } else if (time < 500) { time = 2000 + time; // 2000 - 2499 } red = (float) (0.00023999999999999998 * time); green = (float) (0.00016 * time); } //SUNSET else { red = (float) (-(0.00024019215372297838 * time) + 3.3624499599679742); green = (float) (-(0.0001601281024819856 * time) + 2.2416333066453165); } return this.worldObj.getWorldVec3Pool().getVecFromPool(red, green, green); } }
  11. That works, but what I have is a very abrupt change: @Override public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { if (this.worldObj.getWorldTime() < 14000) { return this.worldObj.getWorldVec3Pool().getVecFromPool(0.6, 0.4, 0.4); } else { return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0); } } How can I make the time fade from night to day and vice versa?
  12. I'm currently using a custom dimension that has custom sky color. WorldProvider: https://github.com/code4240/DarwinMod/blob/master/mod/Minecraft/src/code4240/alien/world/WorldProviderDarwin.java The sky color code: /*** Sky color ***/ @Override public Vec3 getSkyColor(Entity cameraEntity, float partialTicks) { return this.worldObj.getWorldVec3Pool().getVecFromPool(0.6, 0.4, 0.4); } @Override public boolean isSkyColored() { return true; } @Override /** * Return Vec3D with biome specific fog color */ public Vec3 getFogColor(float par1, float par2) { float f2 = MathHelper.cos(par1 * (float)Math.PI * 0.6F) * 0.4F + 0.4F; if (f2 < 0.0F) { f2 = 0.0F; } if (f2 > 1.0F) { f2 = 1.0F; } float f3 = 0.7529412F; float f4 = 0.84705883F; float f5 = 1.0F; f3 *= f2 * 0.94F + 0.06F; f4 *= f2 * 0.94F + 0.06F; f5 *= f2 * 0.91F + 0.09F; return this.worldObj.getWorldVec3Pool().getVecFromPool((double)f3, (double)f4, (double)f5); } } This achieves the desired effect during the day. However, this color appears over the nighttime sky as well, and it looks hideous. Is there a way to make the sky color go away at night without overhauling the renderer?
  13. No. Not peaceful. Hostiles spawn properly. And it's not a monster. At least, it shouldn't be... EDIT: Your inquiry about whether it was a monster inspired me, and I fiddled with the type and got it to spawn!! I was unaware that EntityMob was a monster type. Setting it to extend EntityLiving and setting the spawntype to ambient caused it to spawn. Am I right to presume that setting it to EntityCreature and setting EnumCreatureType to creature would fail because creatures only spawn with the world generator? If so, how might I go about adding this mob as a creature to, say, a custom biome?
  14. I've searched through pages and pages about this particular problem, and despite finding plenty of answers, none of them seemed to help me. The problem I'm having is that my custom mob will not spawn naturally. I got a spawn egg to work, though, and have confirmed that the mob itself works fine. // MOB REGISTRY // spawn egg EntityRegistry.registerGlobalEntityID(EntityArrowtongue.class, "arrowtongue.entity", Mobs.arrowtongueID, 0x990099, 0x990099); //register entity EntityRegistry.registerModEntity(EntityArrowtongue.class, "arrowtongue.entity", Mobs.arrowtongueID, this, 80, 3, true); // register spawn EntityRegistry.addSpawn(EntityArrowtongue.class, 10, 4, 6, EnumCreatureType.creature, BiomeGenBase.plains);//change the values to vary the spawn rarity, biome, etc. No matter what values I pass to addSpawn, it never actually does. Main file where registration occurs: https://github.com/code4240/DarwinMod/blob/master/mod/Minecraft/src/code4240/alien/alien.java EntityArrowtongue: https://github.com/code4240/DarwinMod/blob/master/mod/Minecraft/src/code4240/alien/mob/arrowtongue/EntityArrowtongue.java
×
×
  • Create New...

Important Information

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