• 1

    posted a message on How do I an item in an item frame and its rotation in 1.13

    I am testing out the new snapshots and wanted to build a staircase that opens up when you have the right object in the right position in an item frame. I have done something like this before with the testfor command. However, that command has been removed with these snapshots. I have been messing with the execute and data commands trying to replicate testfor for the past 2-3 hours and cannot figure it out. I can only get it to tell me all of the item frame's data tags. I want the first command block to check if the item frame at a certain coordinate has oak stairs that have been rotated 4 times(so the corner point of the stairs are facing the bottom left corner of the frame). Then I need to chain another command block that runs if the last one returns true. The second command block needs to check if there are spruce planks at a coordinate. If that returns true then it needs to place a redstone block that replaces blocks making it look like a stairway is opening in the floor. Then I need to have the reversed effect, having another command block to run if the oak stairs are not in the correct position, thus having the stairway close. I could have easily done this with testfor, but now I can only figure out how to get all of the itemframe's data tags. It has a part that says you put a data tag name to only check that tag, but when I put ItemRotation it says that there is no such tag.

    Posted in: Recent Updates and Snapshots
  • 0

    posted a message on How to make mob attack closest enemy even after it already has a target

    OK so I got it to check if it is attacking a certain mob but I am not sure how to check if there is a new target available and that it isn't the mob it is attacking etc. I found out if it is attacking KingGuardR and you spawn in a KingR it will forget the KingGuard and go after the King. I am new to modding so sorry if somethings i say/ask are stupid.

    Posted in: Modification Development
  • 0

    posted a message on How to make mob attack closest enemy even after it already has a target

    My mob locks on to its enemy from far away and once it sees it, it won't target anything closer to it. And it targets the enemies in the order i put them in the class so it doesn't matter which one is closer it will go after the one highest on its list usually causing its enemy to be able to kill it. How do i make it so it targets the closest enemy and if a new enemy appears closer to then attack that enemy?


    This is one of their classes(they are all the same but with changes in health and speed etc.)


    package mymod.entity;

    import mymod.entity.projectiles.EntityBAA;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.IRangedAttackMob;
    import net.minecraft.entity.SharedMonsterAttributes;
    import net.minecraft.entity.ai.EntityAIArrowAttack;
    import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
    import net.minecraft.entity.ai.EntityAIWander;
    import net.minecraft.entity.monster.EntityMob;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.World;

    public class EntityArcherB extends EntityMob implements IRangedAttackMob
    {
    public EntityArcherB(World par1World)
    {
    super(par1World);
    this.setSize(0.5F, 2.0F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.0D, 20, 5.0F));
    this.tasks.addTask(1, new EntityAIWander(this, 1.0D));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityKingR.class, 0, true));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityKingGuardR.class, 0, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityArcherR.class, 0, true));
    }

    public boolean isAIEnabled()
    {
    return true;
    }

    protected void applyEntityAttributes()
    {
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(386.0D);
    this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D);
    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setAttribute(100);
    this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(50.0D);
    }
    /**
    * Attack the specified entity using a ranged attack.
    */
    public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
    {
    EntityBAA entitysnowball = new EntityBAA(this.worldObj, this);
    double d0 = par1EntityLivingBase.posX - this.posX;
    double d1 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
    double d2 = par1EntityLivingBase.posZ - this.posZ;
    float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
    entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
    this.playSound("mymod:archer.archeratk", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
    this.worldObj.spawnEntityInWorld(entitysnowball);
    }
    /**
    * Returns the sound this mob makes while it's alive.
    */
    protected String getLivingSound()
    {
    return null;
    }

    /**
    * Returns the sound this mob makes when it is hurt.
    */
    protected String getHurtSound()
    {
    return null;
    }

    /**
    * Returns the sound this mob makes on death.
    */
    protected String getDeathSound()
    {
    return null;
    }

    /**
    * Plays step sound at given x, y, z for the entity
    */
    protected void playStepSound(int par1, int par2, int par3, int par4)
    {
    this.playSound("mymod:archer.archerstep", 0.15F, 1.0F);
    }

    }

    Posted in: Modification Development
  • 0

    posted a message on How do you make a mob attack back when hurt

    I did and the only AI tasks the skeleton has that the zombie doesn't are EntityAIRestrictSun and EntityAIFleeSun.

    They both have EntityAIHurtByTarget but the skeleton fights back and the zombie doesn't. All he does is spawns in reinforcements.

    Posted in: Modification Development
  • 0

    posted a message on How do you make a mob attack back when hurt

    in 1.6.4 zombies dont attack mobs back if they hit it (but skeletons do). I made a mob that extends EntityZombie and i would like to make it attack say a snow golem if it is attacked by it or a skeleton if it is hit by its arrow.

    here is its class file:


    package mymod.entity.zombie;

    import java.util.Calendar;

    import mymod.Main;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityAgeable;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.EntityLivingData;
    import net.minecraft.entity.SharedMonsterAttributes;
    import net.minecraft.entity.ai.EntityAIHurtByTarget;
    import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
    import net.minecraft.entity.ai.EntityAISwimming;
    import net.minecraft.entity.ai.EntityAITarget;
    import net.minecraft.entity.monster.EntityMob;
    import net.minecraft.entity.monster.EntityZombie;
    import net.minecraft.entity.passive.EntityAnimal;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.projectile.EntityArrow;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.potion.Potion;
    import net.minecraft.potion.PotionEffect;
    import net.minecraft.util.DamageSource;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.World;

    public class MyEntityZombie extends EntityZombie
    {
    public MyEntityZombie(World par1World)
    {
    super(par1World);
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
    this.setSize(0.9F, 1.3F);
    }

    protected void applyEntityAttributes()
    {
    super.applyEntityAttributes();
    this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(1100.0D);
    this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(137.5D);
    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setAttribute(11.0D);

    }

    /**
    * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
    * use this to react to sunlight and start to burn.
    */
    public void onLivingUpdate()
    {
    if (!this.worldObj.isRemote)
    {
    if (this.isBurning())
    {
    this.heal(0.011F*this.getHealth());
    this.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 220, 0, true));
    }
    }
    super.onLivingUpdate();
    }

    /**
    * Called when the entity is attacked.
    */
    public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
    {
    if (super.attackEntityFrom(par1DamageSource, par2))
    {
    Entity entity = par1DamageSource.getEntity();

    if (entity != this)
    {
    this.setAttackTarget((EntityLivingBase)entity);
    }

    return true;
    }
    else
    {
    return true;
    }
    }

    protected void dropRareDrop(int par1)
    {
    this.dropItem(Main.MySword.itemID, 1);
    }
    /**
    * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
    * par2 - Level of Looting used to kill this mob.
    */
    protected void dropFewItems(boolean par1, int par2)
    {
    int j = this.rand.nextInt(2 + par2);
    int k;

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Item.rottenFlesh.itemID, 1);
    }

    j = this.rand.nextInt(2 + par2);

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Main.MyItem_3.itemID, 1);
    }

    j = this.rand.nextInt(2 + par2);

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Main.MyItem_2.itemID, 1);
    }

    j = this.rand.nextInt(2 + par2);

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Item.netherStar.itemID, 1);
    }

    j = this.rand.nextInt(2 + par2);

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Main.MyItem_4.itemID, 1);
    }

    j = this.rand.nextInt(2 + par2);

    for (k = 0; k < j; ++k)
    {
    this.dropItem(Block.obsidian.blockID, 1);
    }

    }
    /**
    * Makes entity wear random armor based on difficulty
    */
    protected void addRandomArmor()

    {
    this.setCurrentItemOrArmor(0, new ItemStack(Main.MySword));
    }
    public boolean isAIEnabled()
    {
    return true;
    }

    }

    at the moment it doesnt chase anything that attacks it except the player, but if you hit it in creative(or are in survival) and there is a golem going after it or a skeleton hits it, it will go after it for like 2 sec and will only hit it once.

    Posted in: Modification Development
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    @Licoifi yes that is what i meant/did.

    And if any of you want to check out the resource pack i am adding this to you can find it here.

    Posted in: Resource Pack Help
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    @NDR147 yes you can add random models for blocks

    Posted in: Resource Pack Help
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    You mean my original idea isn't possible right. lol

    Posted in: Resource Pack Help
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    So the closest thing to what I want would be to add a blockstate but name it something that minecraft doesn't recognize and leave instructions on how to rename it to see it in the game.

    Posted in: Resource Pack Help
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    So there is no way of adding an "easter egg" to my resource pack that won't appear in everyday minecraft?

    Posted in: Resource Pack Help
  • 0

    posted a message on how can i add a hidden blockstate that can only be obtained through /setblock[SOLVED]

    As the title says I need help figuring out how to add a hidden blockstate to a block(in my case the glass block)so that you can only get the blockstate with the /setblock command. The only problem is that if i just add another blockstate it randomly picks one of them, but if I make it a 1/1,000,000 chance to get the hidden blockstate it wont place with /setblock. I tried making a new variable but it won't work that way either. I don't have any experience with blockstates before so don't blame me if I ask stupid questions or do/say stupid things.

    Posted in: Resource Pack Help
  • 0

    posted a message on Default 3D resource pack

    I have been occasionally working on a 3D resource pack and decided it was about time I share it with the world. Keep in mind a 3D resource pack takes a long time to make and I rarely work on it so don't be surprised if there is more than a month gap between even small updates.


    This resource pack only changes the models of blocks not the textures so it may not work very well with some texture packs.


    DOWNLOADS:


    Default 3D resource pack 1.0

    changes


    added acacia door

    added activator rail

    added birch door

    added bookshelf

    added crafting table

    added dark oak door

    added detector rail

    added jukebox






    Default 3D resource pack 1.1:

    1.8

    changes


    added brown mushroom
    added change log
    changed pack.png picture to

    added cactus
    added easter egg(http://www.minecraftforum.net/forums/how-can-i-add-a-hidden-blockstate)
    added acacia planks
    added oak planks
    added spruce planks
    added birch planks
    added jungle planks
    added dark oak planks
    added oak door
    added iron door
    added spruce door
    added jungle door
    changed acacia door
    changed birch door
    changed dark oak door
    added acacia fence
    added oak fence
    added spruce fence
    added birch fence
    added jungle fence
    added dark oak fence
    added acacia gate
    added oak gate
    added spruce gate
    added jungle gate
    added diamond sword
    added gold sword
    added iron sword
    added stone sword
    added wooden sword






    1.9

    changes


    added brown mushroom
    added change log
    changed pack.png picture to
    added cactus
    added easter egg(http://www.minecraftforum.net/forums/how-can-i-add-a-hidden-blockstate)
    added acacia planks
    added oak planks
    added spruce planks
    added birch planks
    added jungle planks
    added dark oak planks
    added oak door
    added iron door
    added spruce door
    added jungle door
    changed acacia door
    changed birch door
    changed dark oak door
    added acacia fence
    added oak fence
    added spruce fence
    added birch fence
    added jungle fence
    added dark oak fence
    added acacia gate
    added oak gate
    added spruce gate
    added jungle gate
    added diamond sword
    added easter egg
    added gold sword
    added easter egg
    added iron sword
    added easter egg
    added stone sword
    added easter egg
    added wooden sword
    added easter egg





    Posted in: Resource Packs
  • 0

    posted a message on projectile deflect help

    I want my projectile to be able to be deflected like the ghast's fireball but i cant seem to find the code it uses to do it.

    here is its class:


    package mymod.projectiles;

    import net.minecraft.block.Block;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.monster.EntityBlaze;
    import net.minecraft.entity.projectile.EntityThrowable;
    import net.minecraft.util.AxisAlignedBB;
    import net.minecraft.util.DamageSource;
    import net.minecraft.util.EnumMovingObjectType;
    import net.minecraft.util.MathHelper;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.util.Vec3;
    import net.minecraft.world.World;

    public class EntityDB extends EntityThrowable
    {

    public EntityDB(World par1World)
    {
    super(par1World);
    }

    public EntityDB(World par1World, EntityLivingBase par2EntityLivingBase)
    {
    super(par1World, par2EntityLivingBase);
    }

    public EntityDB(World par1World, double par2, double par4, double par6)
    {
    super(par1World, par2, par4, par6);
    }

    @Override
    protected float getGravityVelocity()
    {
    return 0.00000000001F;
    }

    /**
    * Gets how bright this entity is.
    */
    public float getBrightness(float par1)
    {
    return 1.0F;
    }

    /**
    * Called when this EntityThrowable hits a block or entity.
    */
    protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    {

    int id = worldObj.getBlockId(par1MovingObjectPosition.blockX, par1MovingObjectPosition.blockY, par1MovingObjectPosition.blockZ);
    int newId = 0;
    if(id==Block.obsidian.blockID)
    {
    newId = Block.obsidian.blockID;
    this.setDead();
    }
    else if(id==Block.bedrock.blockID)
    {
    newId = Block.bedrock.blockID;
    this.setDead();
    }
    else
    {
    newId = Block.fire.blockID;
    this.setDead();
    }
    this.worldObj.setBlock(par1MovingObjectPosition.blockX, par1MovingObjectPosition.blockY, par1MovingObjectPosition.blockZ, newId);

    if (par1MovingObjectPosition.entityHit != null)
    {
    byte b0 = 4;

    /**if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
    {
    b0 = 15;
    }*/

    par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)b0);
    }
    if (par1MovingObjectPosition.typeOfHit != null)


    for (int i = 0; i < 8; ++i)
    {
    this.worldObj.spawnParticle("", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    }

    }

    Posted in: Modification Development
  • 0

    posted a message on Anyone have a download for the full default 1.8 resource pack with sounds?

    ok ya your right lets move this to the thread in the link I posted. 3 more things

    1.what should I call it then?

    2.the cool thing about doing this is I am finding minecraft sounds I didn't even know existed(mainly just that wolf howl one I was like did they add that in 1.9 but then I was dissapionted to find out it was an april fools thing)

    3.do you know what the zombie/metal2 was used for? I cant find that one anywhere.

    Posted in: Resource Pack Discussion
  • 0

    posted a message on Anyone have a download for the full default 1.8 resource pack with sounds?

    what do you mean I should probably rename it to remove confusion? right now I am making a default resource pack with the actual sounds then I will replace them (by giving them the same name and moving them into the same folder) with the recording of me saying what the sound is and "I cant use the actual minecraft sounds for copyright purposes"

    Posted in: Resource Pack Discussion
  • To post a comment, please or register a new account.