Jump to content

[Unsolved][1.12.2] Problem on spawning one-per-player-entity spawned by item


_Cruelar_

Recommended Posts

26 minutes ago, _Cruelar_ said:

So what should I use?

Use the ItemStacks NBT there are many ItemStacks.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

Like this?

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head;
import com.cruelar.cruelars_triforcemod.inventory.cruelars_triforcemod;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;
import java.util.Objects;

public class Clawshot_TP extends Item {

    public Clawshot_TP(){
        this.setCreativeTab(cruelars_triforcemod.CRUELARS_TRIFORCEMOD);
        this.setRegistryName("clawshot_tp");
        this.setUnlocalizedName(Cruelars_Triforcemod_Core.MODID+".clawshot_tp");
        this.addPropertyOverride(new ResourceLocation("cast"), new IItemPropertyGetter() {
            @SideOnly(Side.CLIENT)
            public float apply(ItemStack p_apply_1_, @Nullable World p_apply_2_, @Nullable EntityLivingBase p_apply_3_) {
                if (p_apply_3_ == null) {
                    return 0.0F;
                } else {
                    boolean lvt_4_1_ = p_apply_3_.getHeldItemMainhand() == p_apply_1_;
                    boolean lvt_5_1_ = p_apply_3_.getHeldItemOffhand() == p_apply_1_;
                    if (p_apply_3_.getHeldItemMainhand().getItem() instanceof Clawshot_TP) {
                        lvt_5_1_ = false;
                    }

                    return (lvt_4_1_ || lvt_5_1_) && p_apply_3_ instanceof EntityPlayer && ((EntityPlayer)p_apply_3_).fishEntity != null ? 1.0F : 0.0F;
                }
            }
        });
    }

    @Override
    public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityPlayer, EnumHand enumHand) {
        ItemStack itemStack = entityPlayer.getHeldItem(EnumHand.MAIN_HAND);
        Clawshot_Head clawshot_head = new Clawshot_Head(world, entityPlayer);
        if (!world.isRemote) {
            if (this.getTagCompoundSafe(itemStack).getBoolean("shot")) {
                this.getTagCompoundSafe(itemStack).setBoolean("shot",true);
                world.spawnEntity(clawshot_head);
            } else {
                clawshot_head.setDead();
                this.getTagCompoundSafe(itemStack).setBoolean("shot",false);
            }
        }
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }

    @SideOnly(Side.CLIENT)
    public void initModel(){
        ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(Objects.requireNonNull(getRegistryName()), "inventory"));
    }

    private NBTTagCompound getTagCompoundSafe(ItemStack stack) {
        NBTTagCompound tagCompound = stack.getTagCompound();
        if (tagCompound == null) {
            tagCompound = new NBTTagCompound();
            stack.setTagCompound(tagCompound);
        }
        return tagCompound;
    }
}

PS: NBT never worked for me. I've never understand what to do.

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

4 minutes ago, _Cruelar_ said:

PS: NBT never worked for me. I've never understand what to do.

You're not toggling your boolean correctly look at your if statements.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

59 minutes ago, diesieben07 said:

Do not blindly assume the main hand is being used. You are getting the hand passed in as a parameter.

You are ignoring this bullet from D7:

6 minutes ago, _Cruelar_ said:

ItemStack itemStack = entityPlayer.getHeldItem(EnumHand.MAIN_HAND);

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

3 minutes ago, Animefan8888 said:

You're not toggling your boolean correctly look at your if statements.

Thanks forgot to invert the if sentence.

2 minutes ago, Draco18s said:

You are ignoring this bullet from D7:

 

Thanks forgot this. removed that.

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

2 minutes ago, _Cruelar_ said:

Nothing new happens except for me reequiping it every time I use it.

Put a breakpoint in your entities update method after it dies and comes back, does it exist on the server?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

I should have mentioned that since my change the Entity doesn't spawns anymore.

56 minutes ago, _Cruelar_ said:
  • Removed that.
  • Removed that.
  • So when checking for the head beeing not null also check for !world..isRemote ?

Like that:


@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityPlayer, EnumHand enumHand) {
    ItemStack itemStack = entityPlayer.getHeldItem(EnumHand.MAIN_HAND);
        if (clawshot_head==null) {
            Clawshot_Head clawshot_head1 = new Clawshot_Head(world, entityPlayer);
            clawshot_head=clawshot_head1;
            if (!world.isRemote) {
                world.spawnEntity(clawshot_head);
            }
        } else if (!world.isRemote){
            clawshot_head.setDead();
            clawshot_head=null;
        }
    return new ActionResult(EnumActionResult.SUCCESS,itemStack);
}
  • So what should I use?

 

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

2 minutes ago, _Cruelar_ said:

I should have mentioned that since my change the Entity doesn't spawns anymore.

Post updated code.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

The Item:

package com.cruelar.cruelars_triforcemod.items;

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head;
import com.cruelar.cruelars_triforcemod.inventory.cruelars_triforcemod;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;
import java.util.Objects;

public class Clawshot_TP extends Item {

    public Clawshot_TP(){
        this.setCreativeTab(cruelars_triforcemod.CRUELARS_TRIFORCEMOD);
        this.setRegistryName("clawshot_tp");
        this.setUnlocalizedName(Cruelars_Triforcemod_Core.MODID+".clawshot_tp");
        this.addPropertyOverride(new ResourceLocation("cast"), new IItemPropertyGetter() {
            @SideOnly(Side.CLIENT)
            public float apply(ItemStack p_apply_1_, @Nullable World p_apply_2_, @Nullable EntityLivingBase p_apply_3_) {
                if (p_apply_3_ == null) {
                    return 0.0F;
                } else {
                    boolean lvt_4_1_ = p_apply_3_.getHeldItemMainhand() == p_apply_1_;
                    boolean lvt_5_1_ = p_apply_3_.getHeldItemOffhand() == p_apply_1_;
                    if (p_apply_3_.getHeldItemMainhand().getItem() instanceof Clawshot_TP) {
                        lvt_5_1_ = false;
                    }

                    return (lvt_4_1_ || lvt_5_1_) && p_apply_3_ instanceof EntityPlayer && ((EntityPlayer)p_apply_3_).fishEntity != null ? 1.0F : 0.0F;
                }
            }
        });
    }

    @Override
    public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityPlayer, EnumHand enumHand) {
        ItemStack itemStack = new ItemStack(this);
        Clawshot_Head clawshot_head = new Clawshot_Head(world, entityPlayer);
        if (!world.isRemote) {
            if (!this.getTagCompoundSafe(itemStack).getBoolean("shot")) {
                this.getTagCompoundSafe(itemStack).setBoolean("shot",true);
                world.spawnEntity(clawshot_head);
            } else {
                clawshot_head.setDead();
                this.getTagCompoundSafe(itemStack).setBoolean("shot",false);
            }
        }
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }

    @SideOnly(Side.CLIENT)
    public void initModel(){
        ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(Objects.requireNonNull(getRegistryName()), "inventory"));
    }

    private NBTTagCompound getTagCompoundSafe(ItemStack stack) {
        NBTTagCompound tagCompound = stack.getTagCompound();
        if (tagCompound == null) {
            tagCompound = new NBTTagCompound();
            stack.setTagCompound(tagCompound);
        }
        return tagCompound;
    }
}

The Entity:

package com.cruelar.cruelars_triforcemod.entities.projectiles;

import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.Iterator;
import java.util.List;

public class Clawshot_Head extends Entity implements IEntityAdditionalSpawnData{
    private EntityPlayer entityPlayer;
    public Entity caughtEntity;
    public Clawshot_Head.State currentState;
    private static final DataParameter<Integer> DATA_HOOKED_ENTITY;
    private boolean inGround;
    private int ticksInAir;
    private int ticksInGround;
    private boolean shouldRetarct=false;
    public static ResourceLocation RESOURCE_LOCATION=new ResourceLocation("cruelars_triforcemod:textures/entity/projectiles/clawshot_head.png");

    public Clawshot_Head(World world){
        super(world);
    }

    public Clawshot_Head(World world, EntityPlayer entityPlayer){
        super(world);
        this.init(entityPlayer);
        this.currentState = Clawshot_Head.State.FLYING;
        this.setPosition((double)entityPlayer.posX,(double)entityPlayer.posY+entityPlayer.getEyeHeight(),(double)entityPlayer.posX);
        this.shoot(entityPlayer);
    }

    @SideOnly(Side.CLIENT)
    public Clawshot_Head(World world, EntityPlayer entityPlayer, double posX, double posY, double posZ) {
        super(world);
        this.init(entityPlayer);
        this.setPosition(posX,posY,posZ);
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
    }

    public void notifyDataManagerChange(DataParameter<?> p_notifyDataManagerChange_1_) {
        if (DATA_HOOKED_ENTITY.equals(p_notifyDataManagerChange_1_)) {
            int i = (Integer)this.getDataManager().get(DATA_HOOKED_ENTITY);
            this.caughtEntity = i > 0 ? this.world.getEntityByID(i - 1) : null;
        }

        super.notifyDataManagerChange(p_notifyDataManagerChange_1_);
    }

    public void onUpdate()
    {
        super.onUpdate();

        if (this.entityPlayer == null)
        {
            this.setDead();
        }
        else if (this.world.isRemote )
        {
            if (this.inGround)
            {
                ++this.ticksInGround;

                if (this.ticksInGround >= 1200)
                {
                    this.setDead();
                    return;
                }
            }
            BlockPos blockpos = new BlockPos(this);
            IBlockState iblockstate = this.world.getBlockState(blockpos);
            if (this.currentState == Clawshot_Head.State.FLYING)
            {
                if (this.caughtEntity != null)
                {
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                    this.currentState = Clawshot_Head.State.HOOKED_IN_ENTITY;
                    return;
                }

                if (!this.world.isRemote)
                {
                    this.checkCollision();
                }

                if (!this.inGround && !this.onGround && !this.collidedHorizontally)
                {
                    ++this.ticksInAir;
                }
                else
                {
                    this.ticksInAir = 0;
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                }
                if (ticksInAir>=100){
                    this.shouldRetarct=true;
                }
            }
            else
            {
                if (this.currentState == Clawshot_Head.State.HOOKED_IN_ENTITY)
                {
                    if (this.caughtEntity != null)
                    {
                        if (this.caughtEntity.isDead)
                        {
                            this.caughtEntity = null;
                            this.currentState = Clawshot_Head.State.FLYING;
                        }
                        else
                        {
                            this.posX = this.caughtEntity.posX;
                            double d2 = (double)this.caughtEntity.height;
                            this.posY = this.caughtEntity.getEntityBoundingBox().minY + d2 * 0.8D;
                            this.posZ = this.caughtEntity.posZ;
                            this.setPosition(this.posX, this.posY, this.posZ);
                        }
                    }

                    return;
                }
            }

            if (iblockstate.getMaterial() != Material.WATER)
            {
                this.motionY -= 0.03D;
            }

            this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
            this.updateRotation();
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    private void updateRotation()
    {
        float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
        this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI));

        for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
        {
            ;
        }

        while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
        {
            this.prevRotationPitch += 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw < -180.0F)
        {
            this.prevRotationYaw -= 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
        {
            this.prevRotationYaw += 360.0F;
        }

        this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
        this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    }

    public void shoot(Entity entity) {
      System.out.println(entity);
        this.motionX=0.6D*entity.getLookVec().x;
        this.motionY=0.6D*entity.getLookVec().y;
        this.motionZ=0.6D*entity.getLookVec().z;

    }

    public void shoot(double p_shoot_1_, double p_shoot_3_, double p_shoot_5_, float p_shoot_7_, float p_shoot_8_){}

    public int handleHookRetraction()
    {
        if (!this.world.isRemote && this.entityPlayer != null)
        {
            int i = 0;

            net.minecraftforge.event.entity.player.ItemFishedEvent event = null;
            if (this.caughtEntity != null)
            {
                this.bringInHookedEntity();
                this.world.setEntityState(this, (byte)31);
                i = this.caughtEntity instanceof EntityItem ? 3 : 5;
            }
            else if (this.inGround)
            {
                i = 2;
            }

            this.setDead();
            return 0;
        }
        else
        {
            return 0;
        }
    }

    protected void bringInHookedEntity()
    {
        if (this.entityPlayer != null)
        {
            double d0 = this.entityPlayer.posX - this.posX;
            double d1 = this.entityPlayer.posY - this.posY;
            double d2 = this.entityPlayer.posZ - this.posZ;
            double d3 = 0.1D;
            this.caughtEntity.motionX += d0 * 0.1D;
            this.caughtEntity.motionY += d1 * 0.1D;
            this.caughtEntity.motionZ += d2 * 0.1D;
        }
    }

    public void setDead()
    {
        super.setDead();
    }

    public EntityPlayer getAngler()
    {
        return this.entityPlayer;
    }

    private void init(EntityPlayer p_init_1_) {
        this.setSize(0.25F, 0.25F);
        this.ignoreFrustumCheck = true;
        this.entityPlayer = p_init_1_;
    }

    private void checkCollision() {
        Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        RayTraceResult raytraceresult = this.world.rayTraceBlocks(vec3d, vec3d1, false, true, false);
        vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        if (raytraceresult != null) {
            vec3d1 = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y, raytraceresult.hitVec.z);
            entityPlayer.posX=this.posX;
            entityPlayer.posY=this.posY;
            entityPlayer.posZ=this.posZ;
        }

        Entity entity = null;
        List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
        double d0 = 0.0D;
        Iterator var8 = list.iterator();

        while(true) {
            Entity entity1;
            double d1;
            do {
                RayTraceResult raytraceresult1;
                do {
                    do {
                        do {
                            if (!var8.hasNext()) {
                                if (entity != null) {
                                    raytraceresult = new RayTraceResult(entity);
                                }

                                if (raytraceresult != null && raytraceresult.typeOfHit != RayTraceResult.Type.MISS) {
                                    if (raytraceresult.typeOfHit == RayTraceResult.Type.ENTITY) {
                                        this.caughtEntity = raytraceresult.entityHit;
                                        this.setHookedEntity();
                                    } else {
                                        this.inGround = true;
                                    }
                                }

                                return;
                            }

                            entity1 = (Entity)var8.next();
                        } while(!this.canBeHooked(entity1));
                    } while(entity1 == this.entityPlayer && this.ticksInAir < 5);

                    AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().grow(0.30000001192092896D);
                    raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
                } while(raytraceresult1 == null);

                d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);
            } while(d1 >= d0 && d0 != 0.0D);

            entity = entity1;
            d0 = d1;
        }
    }

    private void setHookedEntity() {
        this.getDataManager().set(DATA_HOOKED_ENTITY, this.caughtEntity.getEntityId() + 1);
    }

    protected boolean canBeHooked(Entity p_canBeHooked_1_) {
        return p_canBeHooked_1_.canBeCollidedWith() || p_canBeHooked_1_ instanceof EntityItem;
    }

    protected void entityInit() {
        this.getDataManager().register(DATA_HOOKED_ENTITY, 0);
    }

    @Override
    protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {

    }

    @Override
    protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {

    }

    static {
        DATA_HOOKED_ENTITY = EntityDataManager.createKey(Clawshot_Head.class, DataSerializers.VARINT);
    }

    @Override
    public void writeSpawnData(ByteBuf buffer) {
        buffer.writeBoolean(entityPlayer==null);
        if (entityPlayer!=null) {
            buffer.writeInt(entityPlayer.getEntityId());
        }
    }

    @Override
    public void readSpawnData(ByteBuf additionalData) {
        boolean nullPlayer = additionalData.readBoolean();
        if (!nullPlayer){
            EntityPlayer entityByID=(EntityPlayer) world.getEntityByID(additionalData.readInt());
            if (entityByID!=null){
                entityPlayer=entityByID;
            }
            this.shoot(entityPlayer);
        }
    }

    static enum State {
        FLYING,
        HOOKED_IN_ENTITY;

        private State() {
        }
    }
}

Report of  shoot(Entity entity):


[18:34:17] [main/INFO] [STDOUT]: [com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head:shoot:209]: EntityPlayerSP['Player99'/356, l='MpServer', x=161.70, y=74.62, z=255.17]
[18:34:17] [Server thread/INFO] [STDOUT]: [com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head:shoot:209]: EntityPlayerMP['Player99'/356, l='Triforce Test', x=161.70, y=74.62, z=255.17]

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

34 minutes ago, _Cruelar_ said:

ItemStack itemStack = new ItemStack(this);

What. On Earth. Are you doing?

 

1 hour ago, diesieben07 said:

You are getting the hand passed in as a parameter.

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

16 hours ago, Draco18s said:

What. On Earth. Are you doing?

 

 

Sorry was in a Hurry yesterday, so I took the easiest way to get a ItemStack not the ItemStack.

Replaced it with

ItemStack itemStack = entityPlayer.getHeldItem(enumHand);

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

1 hour ago, _Cruelar_ said:

The Entities spawn die and respawn again

In the fishing rod item is there a delay of some sort for casting, because onItemRightClick may be to fast normally for this.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

There's no delay but the FishHook is saved to the player

Code in ItemFishingRod.class:

public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
    {
        ItemStack itemstack = playerIn.getHeldItem(handIn);

        if (playerIn.fishEntity != null)
        {
            int i = playerIn.fishEntity.handleHookRetraction();
            itemstack.damageItem(i, playerIn);
            playerIn.swingArm(handIn);
            worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_BOBBER_RETRIEVE, SoundCategory.NEUTRAL, 1.0F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
        }
        else
        {
            worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_BOBBER_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));

            if (!worldIn.isRemote)
            {
                EntityFishHook entityfishhook = new EntityFishHook(worldIn, playerIn);
                int j = EnchantmentHelper.getFishingSpeedBonus(itemstack);

                if (j > 0)
                {
                    entityfishhook.setLureSpeed(j);
                }

                int k = EnchantmentHelper.getFishingLuckBonus(itemstack);

                if (k > 0)
                {
                    entityfishhook.setLuck(k);
                }

                worldIn.spawnEntity(entityfishhook);
            }

            playerIn.swingArm(handIn);
            playerIn.addStat(StatList.getObjectUseStats(this));
        }

        return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemstack);
    }

 

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

27 minutes ago, _Cruelar_ said:

There's no delay but the FishHook is saved to the player

You're still not saving a reference to the entity, your creating a new entity every time.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

42 minutes ago, _Cruelar_ said:

Should I save its UUID as NBT or use the Capability system? Or something else.

Save its uuid

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Still spawns at Random places behind me and they still die and respawn.

New code:

package com.cruelar.cruelars_triforcemod.entities.projectiles;

import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.Iterator;
import java.util.List;

public class Clawshot_Head extends Entity implements IEntityAdditionalSpawnData{
    private EntityPlayer entityPlayer;
    public Entity caughtEntity;
    public Clawshot_Head.State currentState;
    private static final DataParameter<Integer> DATA_HOOKED_ENTITY;
    private boolean inGround;
    private int ticksInAir;
    private int ticksInGround;
    private boolean shouldRetarct=false;
    public static ResourceLocation RESOURCE_LOCATION=new ResourceLocation("cruelars_triforcemod:textures/entity/projectiles/clawshot_head.png");

    public Clawshot_Head(World world){
        super(world);
    }

    public Clawshot_Head(World world, EntityPlayer entityPlayer){
        super(world);
        this.init(entityPlayer);
        this.currentState = Clawshot_Head.State.FLYING;
        this.setPosition((double)entityPlayer.posX,(double)entityPlayer.posY+entityPlayer.getEyeHeight(),(double)entityPlayer.posX);
        this.shoot(entityPlayer);
    }

    @SideOnly(Side.CLIENT)
    public Clawshot_Head(World world, EntityPlayer entityPlayer, double posX, double posY, double posZ) {
        super(world);
        this.init(entityPlayer);
        this.setPosition(posX,posY,posZ);
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
    }

    public void notifyDataManagerChange(DataParameter<?> p_notifyDataManagerChange_1_) {
        if (DATA_HOOKED_ENTITY.equals(p_notifyDataManagerChange_1_)) {
            int i = (Integer)this.getDataManager().get(DATA_HOOKED_ENTITY);
            this.caughtEntity = i > 0 ? this.world.getEntityByID(i - 1) : null;
        }

        super.notifyDataManagerChange(p_notifyDataManagerChange_1_);
    }

    public void onUpdate()
    {
        super.onUpdate();

        if (this.entityPlayer == null)
        {
            this.setDead();
        }
        else if (this.world.isRemote )
        {
            if (this.inGround)
            {
                ++this.ticksInGround;

                if (this.ticksInGround >= 1200)
                {
                    this.setDead();
                    return;
                }
            }
            BlockPos blockpos = new BlockPos(this);
            IBlockState iblockstate = this.world.getBlockState(blockpos);
            if (this.currentState == Clawshot_Head.State.FLYING)
            {
                if (this.caughtEntity != null)
                {
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                    this.currentState = Clawshot_Head.State.HOOKED_IN_ENTITY;
                    return;
                }

                if (!this.world.isRemote)
                {
                    this.checkCollision();
                }

                if (!this.inGround && !this.onGround && !this.collidedHorizontally)
                {
                    ++this.ticksInAir;
                }
                else
                {
                    this.ticksInAir = 0;
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                }
                if (ticksInAir>=100){
                    this.shouldRetarct=true;
                }
            }
            else
            {
                if (this.currentState == Clawshot_Head.State.HOOKED_IN_ENTITY)
                {
                    if (this.caughtEntity != null)
                    {
                        if (this.caughtEntity.isDead)
                        {
                            this.caughtEntity = null;
                            this.currentState = Clawshot_Head.State.FLYING;
                        }
                        else
                        {
                            this.posX = this.caughtEntity.posX;
                            double d2 = (double)this.caughtEntity.height;
                            this.posY = this.caughtEntity.getEntityBoundingBox().minY + d2 * 0.8D;
                            this.posZ = this.caughtEntity.posZ;
                            this.setPosition(this.posX, this.posY, this.posZ);
                        }
                    }

                    return;
                }
            }

            if (iblockstate.getMaterial() != Material.WATER)
            {
                this.motionY -= 0.03D;
            }

            this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
            this.updateRotation();
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    private void updateRotation()
    {
        float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
        this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI));

        for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
        {
            ;
        }

        while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
        {
            this.prevRotationPitch += 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw < -180.0F)
        {
            this.prevRotationYaw -= 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
        {
            this.prevRotationYaw += 360.0F;
        }

        this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
        this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    }

    public void shoot(Entity entity) {
        System.out.println(entity);
        this.motionX=0.6D*entity.getLookVec().x;
        this.motionY=0.6D*entity.getLookVec().y;
        this.motionZ=0.6D*entity.getLookVec().z;

    }

    public void shoot(double p_shoot_1_, double p_shoot_3_, double p_shoot_5_, float p_shoot_7_, float p_shoot_8_){}

    public int handleHookRetraction()
    {
        if (!this.world.isRemote && this.entityPlayer != null)
        {
            int i = 0;
            if (this.caughtEntity != null)
            {
                this.bringInHookedEntity();
                this.world.setEntityState(this, (byte)31);
                i = this.caughtEntity instanceof EntityItem ? 3 : 5;
            }
            else if (this.inGround)
            {
                i = 2;
            }

            this.setDead();
            return i;
        }
        else
        {
            return 0;
        }
    }

    protected void bringInHookedEntity()
    {
        if (this.entityPlayer != null)
        {
            double d0 = this.entityPlayer.posX - this.posX;
            double d1 = this.entityPlayer.posY - this.posY;
            double d2 = this.entityPlayer.posZ - this.posZ;
            double d3 = 0.1D;
            this.caughtEntity.motionX += d0 * 0.1D;
            this.caughtEntity.motionY += d1 * 0.1D;
            this.caughtEntity.motionZ += d2 * 0.1D;
        }
    }

    public void setDead()
    {
        super.setDead();
    }

    public EntityPlayer getAngler()
    {
        return this.entityPlayer;
    }

    private void init(EntityPlayer p_init_1_) {
        this.setSize(0.25F, 0.25F);
        this.ignoreFrustumCheck = true;
        this.entityPlayer = p_init_1_;
    }

    private void checkCollision() {
        Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        RayTraceResult raytraceresult = this.world.rayTraceBlocks(vec3d, vec3d1, false, true, false);
        vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        if (raytraceresult != null) {
            vec3d1 = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y, raytraceresult.hitVec.z);
            this.motionX=0;
            this.motionY=0;
            this.motionZ=0;
            entityPlayer.posX=this.posX;
            entityPlayer.posY=this.posY;
            entityPlayer.posZ=this.posZ;
        }

        Entity entity = null;
        List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
        double d0 = 0.0D;
        Iterator var8 = list.iterator();

        while(true) {
            Entity entity1;
            double d1;
            do {
                RayTraceResult raytraceresult1;
                do {
                    do {
                        do {
                            if (!var8.hasNext()) {
                                if (entity != null) {
                                    raytraceresult = new RayTraceResult(entity);
                                }

                                if (raytraceresult != null && raytraceresult.typeOfHit != RayTraceResult.Type.MISS) {
                                    if (raytraceresult.typeOfHit == RayTraceResult.Type.ENTITY) {
                                        this.caughtEntity = raytraceresult.entityHit;
                                        this.setHookedEntity();
                                    } else {
                                        this.inGround = true;
                                    }
                                }

                                return;
                            }

                            entity1 = (Entity)var8.next();
                        } while(!this.canBeHooked(entity1));
                    } while(entity1 == this.entityPlayer && this.ticksInAir < 5);

                    AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().grow(0.30000001192092896D);
                    raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
                } while(raytraceresult1 == null);

                d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);
            } while(d1 >= d0 && d0 != 0.0D);

            entity = entity1;
            d0 = d1;
        }
    }

    private void setHookedEntity() {
        this.getDataManager().set(DATA_HOOKED_ENTITY, this.caughtEntity.getEntityId() + 1);
    }

    protected boolean canBeHooked(Entity p_canBeHooked_1_) {
        return p_canBeHooked_1_.canBeCollidedWith() || p_canBeHooked_1_ instanceof EntityItem;
    }

    protected void entityInit() {
        this.getDataManager().register(DATA_HOOKED_ENTITY, 0);
    }

    @Override
    protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {

    }

    @Override
    protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {

    }

    static {
        DATA_HOOKED_ENTITY = EntityDataManager.createKey(Clawshot_Head.class, DataSerializers.VARINT);
    }

    @Override
    public void writeSpawnData(ByteBuf buffer) {
        buffer.writeBoolean(entityPlayer==null);
        if (entityPlayer!=null) {
            buffer.writeInt(entityPlayer.getEntityId());
        }
    }

    @Override
    public void readSpawnData(ByteBuf additionalData) {
        boolean nullPlayer = additionalData.readBoolean();
        if (!nullPlayer){
            EntityPlayer entityByID=(EntityPlayer) world.getEntityByID(additionalData.readInt());
            if (entityByID!=null){
                entityPlayer=entityByID;
            }
            this.shoot(entityPlayer);
        }
    }

    static enum State {
        FLYING,
        HOOKED_IN_ENTITY;

        private State() {
        }
    }
}

 

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

What the Heck is causing this?

The Entity spawns 36 Blocks in negative Z direction from me.

Updated Entity code:

Spoiler

package com.cruelar.cruelars_triforcemod.entities.projectiles;

import io.netty.buffer.ByteBuf;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.Iterator;
import java.util.List;

public class Clawshot_Head extends Entity implements IEntityAdditionalSpawnData{
    private EntityPlayer entityPlayer;
    public Entity caughtEntity;
    public Clawshot_Head.State currentState;
    private static final DataParameter<Integer> DATA_HOOKED_ENTITY;
    private boolean inGround;
    private int ticksInAir;
    private int ticksInGround;
    private boolean shouldRetarct=false;
    public static ResourceLocation RESOURCE_LOCATION=new ResourceLocation("cruelars_triforcemod:textures/entity/projectiles/clawshot_head.png");

    public Clawshot_Head(World world){
        super(world);
    }

    public Clawshot_Head(World world, EntityPlayer entityPlayer){
        super(world);
        this.init(entityPlayer);
        this.currentState = Clawshot_Head.State.FLYING;
        this.setPosition((double)entityPlayer.posX,(double)entityPlayer.posY+entityPlayer.getEyeHeight(),(double)entityPlayer.posX);
        this.shoot(entityPlayer);
    }

    @SideOnly(Side.CLIENT)
    public Clawshot_Head(World world, EntityPlayer entityPlayer, double posX, double posY, double posZ) {
        super(world);
        this.init(entityPlayer);
        this.setPosition(posX,posY,posZ);
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
    }

    public void notifyDataManagerChange(DataParameter<?> p_notifyDataManagerChange_1_) {
        if (DATA_HOOKED_ENTITY.equals(p_notifyDataManagerChange_1_)) {
            int i = (Integer)this.getDataManager().get(DATA_HOOKED_ENTITY);
            this.caughtEntity = i > 0 ? this.world.getEntityByID(i - 1) : null;
        }

        super.notifyDataManagerChange(p_notifyDataManagerChange_1_);
    }

    public void onUpdate()
    {
        super.onUpdate();

        if (this.entityPlayer == null)
        {
            this.setDead();
        }
        else if (this.world.isRemote )
        {
            if (this.inGround)
            {
                ++this.ticksInGround;

                if (this.ticksInGround >= 1200)
                {
                    this.setDead();
                    return;
                }
            }
            if(this.getDistance(entityPlayer)>=64){
                this.setDead();
            }
            BlockPos blockpos = new BlockPos(this);
            IBlockState iblockstate = this.world.getBlockState(blockpos);
            if (this.currentState == Clawshot_Head.State.FLYING)
            {
                if (this.caughtEntity != null)
                {
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                    this.currentState = Clawshot_Head.State.HOOKED_IN_ENTITY;
                    return;
                }

                if (!this.world.isRemote)
                {
                    this.checkCollision();
                }

                if (!this.inGround && !this.onGround && !this.collidedHorizontally)
                {
                    ++this.ticksInAir;
                }
                else
                {
                    this.ticksInAir = 0;
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                }
                if (ticksInAir>=100){
                    this.shouldRetarct=true;
                }
            }
            else
            {
                if (this.currentState == Clawshot_Head.State.HOOKED_IN_ENTITY)
                {
                    if (this.caughtEntity != null)
                    {
                        if (this.caughtEntity.isDead)
                        {
                            this.caughtEntity = null;
                            this.currentState = Clawshot_Head.State.FLYING;
                        }
                        else
                        {
                            this.posX = this.caughtEntity.posX;
                            double d2 = (double)this.caughtEntity.height;
                            this.posY = this.caughtEntity.getEntityBoundingBox().minY + d2 * 0.8D;
                            this.posZ = this.caughtEntity.posZ;
                            this.setPosition(this.posX, this.posY, this.posZ);
                        }
                    }

                    return;
                }
            }

            this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
            this.updateRotation();
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    private void updateRotation()
    {
        float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
        this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI));

        for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
        {
            ;
        }

        while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
        {
            this.prevRotationPitch += 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw < -180.0F)
        {
            this.prevRotationYaw -= 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
        {
            this.prevRotationYaw += 360.0F;
        }

        this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
        this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    }

    public void shoot(Entity entity) {
        System.out.println(entity);
        this.motionX=0.6D*entity.getLookVec().x;
        this.motionY=0.6D*entity.getLookVec().y;
        this.motionZ=0.6D*entity.getLookVec().z;

    }

    public void shoot(double p_shoot_1_, double p_shoot_3_, double p_shoot_5_, float p_shoot_7_, float p_shoot_8_){}

    public int handleHookRetraction()
    {
        if (!this.world.isRemote && this.entityPlayer != null)
        {
            int i = 0;
            if (this.caughtEntity != null)
            {
                this.bringInHookedEntity();
                this.world.setEntityState(this, (byte)31);
                i = this.caughtEntity instanceof EntityItem ? 3 : 5;
            }
            else if (this.inGround)
            {
                i = 2;
            }

            this.setDead();
            return i;
        }
        else
        {
            return 0;
        }
    }

    protected void bringInHookedEntity()
    {
        if (this.entityPlayer != null)
        {
            double d0 = this.entityPlayer.posX - this.posX;
            double d1 = this.entityPlayer.posY - this.posY;
            double d2 = this.entityPlayer.posZ - this.posZ;
            double d3 = 0.1D;
            this.caughtEntity.motionX += d0 * 0.1D;
            this.caughtEntity.motionY += d1 * 0.1D;
            this.caughtEntity.motionZ += d2 * 0.1D;
        }
    }

    public void setDead()
    {
        super.setDead();
    }

    public EntityPlayer getAngler()
    {
        return this.entityPlayer;
    }

    private void init(EntityPlayer p_init_1_) {
        this.setSize(0.25F, 0.25F);
        this.ignoreFrustumCheck = true;
        this.entityPlayer = p_init_1_;
    }

    private void checkCollision() {
        Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        RayTraceResult raytraceresult = this.world.rayTraceBlocks(vec3d, vec3d1, false, true, false);
        vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        if (raytraceresult != null) {
            vec3d1 = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y, raytraceresult.hitVec.z);
            this.motionX=0;
            this.motionY=0;
            this.motionZ=0;
            entityPlayer.posX=this.posX;
            entityPlayer.posY=this.posY;
            entityPlayer.posZ=this.posZ;
        }

        Entity entity = null;
        List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
        double d0 = 0.0D;
        Iterator var8 = list.iterator();

        while(true) {
            Entity entity1;
            double d1;
            do {
                RayTraceResult raytraceresult1;
                do {
                    do {
                        do {
                            if (!var8.hasNext()) {
                                if (entity != null) {
                                    raytraceresult = new RayTraceResult(entity);
                                }

                                if (raytraceresult != null && raytraceresult.typeOfHit != RayTraceResult.Type.MISS) {
                                    if (raytraceresult.typeOfHit == RayTraceResult.Type.ENTITY) {
                                        this.caughtEntity = raytraceresult.entityHit;
                                        this.setHookedEntity();
                                    } else {
                                        this.inGround = true;
                                    }
                                }

                                return;
                            }

                            entity1 = (Entity)var8.next();
                        } while(!this.canBeHooked(entity1));
                    } while(entity1 == this.entityPlayer && this.ticksInAir < 5);

                    AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().grow(0.30000001192092896D);
                    raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
                } while(raytraceresult1 == null);

                d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);
            } while(d1 >= d0 && d0 != 0.0D);

            entity = entity1;
            d0 = d1;
        }
    }

    private void setHookedEntity() {
        this.getDataManager().set(DATA_HOOKED_ENTITY, this.caughtEntity.getEntityId() + 1);
    }

    protected boolean canBeHooked(Entity p_canBeHooked_1_) {
        return p_canBeHooked_1_.canBeCollidedWith() || p_canBeHooked_1_ instanceof EntityItem;
    }

    protected void entityInit() {
        this.getDataManager().register(DATA_HOOKED_ENTITY, 0);
    }

    @Override
    protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {

    }

    @Override
    protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {

    }

    static {
        DATA_HOOKED_ENTITY = EntityDataManager.createKey(Clawshot_Head.class, DataSerializers.VARINT);
    }

    @Override
    public void writeSpawnData(ByteBuf buffer) {
        buffer.writeBoolean(entityPlayer==null);
        if (entityPlayer!=null) {
            buffer.writeInt(entityPlayer.getEntityId());
        }
    }

    @Override
    public void readSpawnData(ByteBuf additionalData) {
        boolean nullPlayer = additionalData.readBoolean();
        if (!nullPlayer){
            EntityPlayer entityByID=(EntityPlayer) world.getEntityByID(additionalData.readInt());
            if (entityByID!=null){
                entityPlayer=entityByID;
            }
            this.shoot(entityPlayer);
        }
    }

    static enum State {
        FLYING,
        HOOKED_IN_ENTITY;

        private State() {
        }
    }
}

 

Item code:

Spoiler

package com.cruelar.cruelars_triforcemod.items;

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head;
import com.cruelar.cruelars_triforcemod.inventory.cruelars_triforcemod;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;
import java.util.Objects;

public class Clawshot_TP extends Item {

    public Clawshot_TP(){
        this.setCreativeTab(cruelars_triforcemod.CRUELARS_TRIFORCEMOD);
        this.setRegistryName("clawshot_tp");
        this.setUnlocalizedName(Cruelars_Triforcemod_Core.MODID+".clawshot_tp");
        this.addPropertyOverride(new ResourceLocation("cast"), new IItemPropertyGetter() {
            @SideOnly(Side.CLIENT)
            public float apply(ItemStack p_apply_1_, @Nullable World p_apply_2_, @Nullable EntityLivingBase p_apply_3_) {
                if (p_apply_3_ == null) {
                    return 0.0F;
                } else {
                    boolean lvt_4_1_ = p_apply_3_.getHeldItemMainhand() == p_apply_1_;
                    boolean lvt_5_1_ = p_apply_3_.getHeldItemOffhand() == p_apply_1_;
                    if (p_apply_3_.getHeldItemMainhand().getItem() instanceof Clawshot_TP) {
                        lvt_5_1_ = false;
                    }

                    return (lvt_4_1_ || lvt_5_1_) && p_apply_3_ instanceof EntityPlayer && ((EntityPlayer)p_apply_3_).fishEntity != null ? 1.0F : 0.0F;
                }
            }
        });
    }

    @Override
    public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityPlayer,EnumHand enumHand) {
        ItemStack itemStack = entityPlayer.getHeldItem(enumHand);
        Clawshot_Head clawshot_head = new Clawshot_Head(world, entityPlayer);
        if (!world.isRemote) {
            if (this.getTagCompoundSafe(itemStack).getInteger("head")==0 || Objects.requireNonNull(world.getEntityByID(this.getTagCompoundSafe(itemStack).getInteger("head"))).isDead) {
                world.spawnEntity(clawshot_head);
                this.getTagCompoundSafe(itemStack).setBoolean("shot",true);
                this.getTagCompoundSafe(itemStack).setInteger("head",clawshot_head.getEntityId());
            } else {
                clawshot_head.setDead();
                this.getTagCompoundSafe(itemStack).setBoolean("shot",false);
                this.getTagCompoundSafe(itemStack).setInteger("head",0);
            }
        }
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }

    @SideOnly(Side.CLIENT)
    public void initModel(){
        ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(Objects.requireNonNull(getRegistryName()), "inventory"));
    }

    private NBTTagCompound getTagCompoundSafe(ItemStack stack) {
        NBTTagCompound tagCompound = stack.getTagCompound();
        if (tagCompound == null) {
            tagCompound = new NBTTagCompound();
            stack.setTagCompound(tagCompound);
        }
        return tagCompound;
    }
}

 

 

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

Yeah okay missed that. But what's about the still respawning Entities. I can't kill them without commands while they seem to disappear after reloading the world.

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

I can't post at GitHub at the moment but I'll give all code Referring to this Item and the Entity:

CommonProxy(will change that Code Style #1)

Spoiler

package com.cruelar.cruelars_triforcemod.proxy;

import com.cruelar.cruelars_triforcemod.*;
import com.cruelar.cruelars_triforcemod.init.ModArmor;
import com.cruelar.cruelars_triforcemod.init.ModBlocks;
import com.cruelar.cruelars_triforcemod.init.ModEntities;
import com.cruelar.cruelars_triforcemod.init.ModItems;
import com.cruelar.cruelars_triforcemod.blocks.*;
import com.cruelar.cruelars_triforcemod.items.*;
import com.cruelar.cruelars_triforcemod.tileentity.False_Block_TileEntity;
import com.cruelar.cruelars_triforcemod.tileentity.Hidden_Block_TileEntity;
import com.cruelar.cruelars_triforcemod.tileentity.Pedestal_Of_Time_TileEntity;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionType;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.registry.GameRegistry;

import java.io.File;
import java.util.Objects;

import static com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core.instance;

@Mod.EventBusSubscriber(modid = Cruelars_Triforcemod_Core.MODID)
public class CommonProxy {
    public static Configuration config;


    public void preInit(FMLPreInitializationEvent event) {
        File directory = event.getModConfigurationDirectory();
        config = new Configuration(new File(directory.getPath(),"cruelars_triforcemod.cfg"));
        Config.readConfig();
        ModEntities.init();

    }

    public void init(FMLInitializationEvent event) {
        NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiProxy());
        registerSmelting();
    }

    public void postInit(FMLPostInitializationEvent event){
        if (config.hasChanged()){
            config.save();
        }
    }

    @SubscribeEvent
    public static void registerBlocks(RegistryEvent.Register<net.minecraft.block.Block> event){
        event.getRegistry().register(new Dungeonbrick());
        event.getRegistry().register(new Shrine_Wall_Left_Bottom());
        event.getRegistry().register(new Shrine_Wall_Right_Bottom());
        event.getRegistry().register(new Shrine_Wall_Left_Upper());
        event.getRegistry().register(new Shrine_Wall_Right_Upper());
        event.getRegistry().register(new Pedestal_Of_Time());
        GameRegistry.registerTileEntity(Pedestal_Of_Time_TileEntity.class,new ResourceLocation("cruelars_triforcemod:tileentity/Pedestal_Of_Time_TileEntty"));
        event.getRegistry().register(new Lock());
        event.getRegistry().register(new False_Block());
        event.getRegistry().register(new Hidden_Block());
        GameRegistry.registerTileEntity(False_Block_TileEntity.class,new ResourceLocation("cruelars_triforcemod:tileentity/False_Block_TileEntity"));
        GameRegistry.registerTileEntity(Hidden_Block_TileEntity.class,new ResourceLocation("cruelars_triforcemod:tileentity/Hidden_Block_TileEntity"));
    }

    @SubscribeEvent
    public static void registerItems(RegistryEvent.Register<Item> event){
        event.getRegistry().register(new ItemBlock(ModBlocks.dungeonbrick).setRegistryName(Objects.requireNonNull(ModBlocks.dungeonbrick.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.shrine_wall_left_bottom).setRegistryName(Objects.requireNonNull(ModBlocks.shrine_wall_left_bottom.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.shrine_wall_right_bottom).setRegistryName(Objects.requireNonNull(ModBlocks.shrine_wall_right_bottom.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.shrine_wall_left_upper).setRegistryName(Objects.requireNonNull(ModBlocks.shrine_wall_left_upper.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.shrine_wall_right_upper).setRegistryName(Objects.requireNonNull(ModBlocks.shrine_wall_right_upper.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.pedestal_of_time).setRegistryName(Objects.requireNonNull(ModBlocks.pedestal_of_time.getRegistryName())));
        event.getRegistry().register(new Green_Rupee());
        event.getRegistry().register(new Blue_Rupee());
        event.getRegistry().register(new Red_Rupee());
        event.getRegistry().register(new Purple_Rupee());
        event.getRegistry().register(new Silver_Rupee());
        event.getRegistry().register(new Golden_Rupee());
        event.getRegistry().register(new True_Master_Sword());
        event.getRegistry().register(new Hyliashield());
        event.getRegistry().register(new Bokoblin_Horn());
        event.getRegistry().register(new Bokoblin_Fang());
        event.getRegistry().register(new Bokoblin_Heart());
        event.getRegistry().register(new Sword_Of_The_Six_Sages());
        event.getRegistry().register(new Shadow_Crystal());
        event.getRegistry().register(new Fire_Arrow());
        event.getRegistry().register(new Ice_Arrow());
        event.getRegistry().register(new Shock_Arrow());
        event.getRegistry().register(new Bomb_Arrow());
        event.getRegistry().register(new Goddess_Sword());
        event.getRegistry().register(new Farosh_Scale());
        event.getRegistry().register(new Dinraal_Scale());
        event.getRegistry().register(new Naydra_Scale());
        event.getRegistry().register(new Master_Ore());
        event.getRegistry().register(new Mastermetal_Ingot());
        event.getRegistry().register(new Masterhilt());
        event.getRegistry().register(new Ocarina_Of_Time());
        event.getRegistry().register(new Triforce());
        event.getRegistry().register(new ModArmor("wool_shirt","wool",ModItems.wool, EntityEquipmentSlot.CHEST));
        event.getRegistry().register(new ModArmor("wool_cap","wool",ModItems.wool, EntityEquipmentSlot.HEAD));
        event.getRegistry().register(new ModArmor("wool_leggings","wool",ModItems.wool, EntityEquipmentSlot.LEGS));
        event.getRegistry().register(new ModArmor("kokiri_shirt","kokiri",ModItems.wool, EntityEquipmentSlot.CHEST));
        event.getRegistry().register(new ModArmor("kokiri_cap","kokiri",ModItems.wool, EntityEquipmentSlot.HEAD));
        event.getRegistry().register(new ModArmor("heros_new_cap","invisible",ModItems.wool, EntityEquipmentSlot.HEAD));
        event.getRegistry().register(new ModArmor("heros_new_boots","invisible",ModItems.wool, EntityEquipmentSlot.FEET));
        event.getRegistry().register(new ModArmor("heros_new_leggings","invisible",ModItems.wool, EntityEquipmentSlot.LEGS));
        event.getRegistry().register(new ModArmor("heros_new_clothes","invisible",ModItems.wool, EntityEquipmentSlot.CHEST));
        event.getRegistry().register(new Shiekah_Slate());
        event.getRegistry().register(new ModArmor("heros_clothes","hero",ModItems.wool, EntityEquipmentSlot.CHEST));
        event.getRegistry().register(new ModArmor("heros_cap","hero",ModItems.wool, EntityEquipmentSlot.HEAD));
        event.getRegistry().register(new Champions_Tunic());
        event.getRegistry().register(new Ooccoo());
        event.getRegistry().register(new Majoras_Mask());
        event.getRegistry().register(new Amber());
        event.getRegistry().register(new Opal());
        event.getRegistry().register(new Ruby_BOTW());
        event.getRegistry().register(new Sapphire());
        event.getRegistry().register(new Topaz());
        event.getRegistry().register(new Bomb());
        event.getRegistry().register(new Goron_Shirt());
        event.getRegistry().register(new Goron_Cap());
        event.getRegistry().register(new Zora_Shirt());
        event.getRegistry().register(new Zora_Cap());
        event.getRegistry().register(new Iron_Boots_TP());
        event.getRegistry().register(new Lens_Of_Truth());
        event.getRegistry().register(new Clawshot_TP());
        event.getRegistry().register(new Key());
        event.getRegistry().register(new ItemLock());
        event.getRegistry().register(new ItemBlock(ModBlocks.false_block).setRegistryName(Objects.requireNonNull(ModBlocks.false_block.getRegistryName())));
        event.getRegistry().register(new ItemBlock(ModBlocks.hidden_block).setRegistryName(Objects.requireNonNull(ModBlocks.hidden_block.getRegistryName())));
        event.getRegistry().register(new Sword_Of_A_Phantom_PH());
        event.getRegistry().register(new PhantomShieldPH());
        event.getRegistry().register(new Megaton_Hammer());
        }

    @SubscribeEvent
    @Optional.Method(modid = "baubles")
    public static void registerAPIItems(RegistryEvent.Register<Item> event) {
        event.getRegistry().register(new Gorons_Bracelet());
    }

}

 

ClientProxy:

Spoiler

package com.cruelar.cruelars_triforcemod.proxy;

import com.cruelar.cruelars_triforcemod.*;
import com.cruelar.cruelars_triforcemod.init.EntitySpawnHandler;
import com.cruelar.cruelars_triforcemod.init.ModBlocks;
import com.cruelar.cruelars_triforcemod.init.ModEntities;
import com.cruelar.cruelars_triforcemod.init.ModItems;
import com.cruelar.cruelars_triforcemod.gui.Ocarina_Of_Time_GUI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@Mod.EventBusSubscriber(value = { Side.CLIENT },modid = Cruelars_Triforcemod_Core.MODID)
public class ClientProxy extends CommonProxy {
    private static final ModelBiped armorBase = new ModelBiped(0.5F);

    @Override
    public void preInit(FMLPreInitializationEvent event){
        super.preInit(event);

        OBJLoader.INSTANCE.addDomain(Cruelars_Triforcemod_Core.MODID);
    }

    @SideOnly(Side.CLIENT)
    public static void init() {
        Minecraft mc = Minecraft.getMinecraft();
        mc.displayGuiScreen(new Ocarina_Of_Time_GUI());
        if (!Config.allowMinecraftSpawning){
            MinecraftForge.EVENT_BUS.register(new EntitySpawnHandler());
        }
    }

    @SubscribeEvent
    public static void registerModels(ModelRegistryEvent event){
        ModBlocks.initModels();
        ModItems.initModels();
        ModEntities.initModels();
    }

    @SubscribeEvent
    @Optional.Method(modid = "baubles")
    public static void registerAPIModels(ModelRegistryEvent event){
        ModItems.initAPIModels();
    }

}

 

ModItems:

Spoiler

package com.cruelar.cruelars_triforcemod.init;

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.items.*;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.ItemModelMesher;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.resources.IReloadableResourceManager;
import net.minecraft.client.resources.IResourceManagerReloadListener;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ModItems  {
    private static ItemModelMesher itemModelMesher;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:green_rupee")
    public static Green_Rupee green_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:blue_rupee")
    public static Blue_Rupee blue_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:red_rupee")
    public static Red_Rupee red_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:purple_rupee")
    public static Purple_Rupee purple_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:silver_rupee")
    public static Silver_Rupee silver_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:golden_rupee")
    public static Golden_Rupee golden_rupee;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:true_master_sword")
    public static True_Master_Sword true_master_sword;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:hyliashield")
    public static Hyliashield hyliashield;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:bokoblin_horn")
    public static Bokoblin_Horn bokoblin_horn;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:bokoblin_fang")
    public static Bokoblin_Fang bokoblin_fang;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:bokoblin_heart")
    public static Bokoblin_Heart bokoblin_heart;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:sword_of_the_six_sages")
    public static Sword_Of_The_Six_Sages sword_of_the_six_sages;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:shadow_crystal")
    public static Shadow_Crystal shadow_crystal;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:ice_arrow")
    public static Ice_Arrow ice_arrow;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:fire_arrow")
    public static Fire_Arrow fire_arrow;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:shock_arrow")
    public static Shock_Arrow shock_arrow;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:bomb_arrow")
    public static Bomb_Arrow bomb_arrow;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:goddess_sword")
    public static Goddess_Sword goddess_sword;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:farosh_scale")
    public static Farosh_Scale farosh_scale;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:dinraal_scale")
    public static Dinraal_Scale dinraal_scale;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:naydra_scale")
    public static Naydra_Scale naydra_scale;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:master_ore")
    public static Master_Ore master_ore;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:mastermetal_ingot")
    public static Mastermetal_Ingot mastermetal_ingot;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:masterhilt")
    public static Masterhilt masterhilt;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:ocarina_of_time")
    public static Ocarina_Of_Time ocarina_of_time;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:triforce")
    public static Triforce triforce;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:wool_shirt")
    public static ModArmor wool_shirt;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:wool_cap")
    public static ModArmor wool_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:wool_leggings")
    public static ModArmor wool_leggings;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:kokiri_shirt")
    public static ModArmor kokiri_shirt;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:kokiri_cap")
    public static ModArmor kokiri_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_new_cap")
    public static ModArmor heros_new_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_new_boots")
    public static ModArmor heros_new_boots;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_new_leggings")
    public static ModArmor heros_new_leggings;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_new_clothes")
    public static ModArmor heros_new_clothes;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:shiekah_slate")
    public static Shiekah_Slate shiekah_slate;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_clothes")
    public static ModArmor heros_clothes;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:heros_cap")
    public static ModArmor heros_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:champions_tunic")
    public static Champions_Tunic champions_tunic;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:ooccoo")
    public static Ooccoo ooccoo;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:majoras_mask")
    public static Majoras_Mask majoras_mask;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:amber")
    public static Amber amber;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:opal")
    public static Opal opal;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:ruby_botw")
    public static Ruby_BOTW ruby_botw;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:sapphire")
    public static Sapphire sapphire;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:topaz")
    public static Topaz topaz;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:gorons_bracelet")
    public static Gorons_Bracelet gorons_bracelet;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:bomb")
    public static Bomb bomb;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:goron_shirt")
    public static Goron_Shirt goron_shirt;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:goron_cap")
    public static Goron_Cap goron_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:zora_shirt")
    public static Zora_Shirt zora_shirt;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:zora_cap")
    public static Zora_Cap zora_cap;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:iron_boots_tp")
    public static Iron_Boots_TP iron_boots_tp;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:lens_of_truth")
    public static Lens_Of_Truth lens_of_truth;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:clawshot_tp")
    public static Clawshot_TP clawshot_tp;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:key")
    public static Key key;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:lock")
    public static ItemLock itemLock;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:sword_of_a_phantom_ph")
    public static Sword_Of_A_Phantom_PH sword_of_a_phantom_ph;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:phantom_shield_ph")
    public static PhantomShieldPH phantomShieldPH;

    @GameRegistry.ObjectHolder("cruelars_triforcemod:megaton_hammer")
    public static Megaton_Hammer megaton_hammer;


    public static final Item.ToolMaterial mastermetal = EnumHelper.addToolMaterial(Cruelars_Triforcemod_Core.MODID + ":MASTERMETAL", 4, 250, 6.0F, 26.0F, 14);
    public static final Item.ToolMaterial goddessmastermetal = EnumHelper.addToolMaterial(Cruelars_Triforcemod_Core.MODID + ":GODDESSMASTERMETAL", 4, 1024, 6.0F, 11.0F, 14);
    public static final Item.ToolMaterial phantommetal = EnumHelper.addToolMaterial(Cruelars_Triforcemod_Core.MODID + ":PHANTOMMETAL", 4, 1024, 6.0F, 0.0F, 14);
    public static final ItemArmor.ArmorMaterial wool = EnumHelper.addArmorMaterial(Cruelars_Triforcemod_Core.MODID + ":WOOL", "wool", 1, new int[]{0,0,0,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER,0.0F);
    public static final ItemArmor.ArmorMaterial champion = EnumHelper.addArmorMaterial(Cruelars_Triforcemod_Core.MODID + ":CHAMPION", "champion", 1, new int[]{0,0,5,0}, 0, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER,0.0F);
    public static final ItemArmor.ArmorMaterial majora = EnumHelper.addArmorMaterial(Cruelars_Triforcemod_Core.MODID + ":MAJORA", "majora", 1, new int[]{0,0,0,1}, 0, SoundEvents.ITEM_ARMOR_EQUIP_LEATHER,0.0F);

    @SideOnly(Side.CLIENT)
    public static void initModels(){
        green_rupee.initModel();
        blue_rupee.initModel();
        red_rupee.initModel();
        purple_rupee.initModel();
        silver_rupee.initModel();
        golden_rupee.initModel();
        true_master_sword.initModel();
        hyliashield.initModel();
        bokoblin_horn.initModel();
        bokoblin_fang.initModel();
        bokoblin_heart.initModel();
        sword_of_the_six_sages.initModel();
        shadow_crystal.initModel();
        fire_arrow.initModel();
        ice_arrow.initModel();
        shock_arrow.initModel();
        bomb_arrow.initModel();
        goddess_sword.initModel();
        farosh_scale.initModel();
        dinraal_scale.initModel();
        naydra_scale.initModel();
        master_ore.initModel();
        mastermetal_ingot.initModel();
        masterhilt.initModel();
        ocarina_of_time.initModel();
        triforce.initModel();
        wool_shirt.initModel();
        wool_cap.initModel();
        wool_leggings.initModel();
        kokiri_shirt.initModel();
        kokiri_cap.initModel();
        heros_new_cap.initModel();
        heros_new_boots.initModel();
        heros_new_leggings.initModel();
        heros_new_clothes.initModel();
        shiekah_slate.initModel();
        heros_clothes.initModel();
        heros_cap.initModel();
        champions_tunic.initModel();
        ooccoo.initModel();
        majoras_mask.initModel();
        amber.initModel();
        opal.initModel();
        ruby_botw.initModel();
        sapphire.initModel();
        topaz.initModel();
        bomb.initModel();
        goron_shirt.initModel();
        goron_cap.initModel();
        zora_shirt.initModel();
        zora_cap.initModel();
        iron_boots_tp.initModel();
        lens_of_truth.initModel();
        clawshot_tp.initModel();
        key.initModel();
        itemLock.initModel();
        sword_of_a_phantom_ph.initModel();
        phantomShieldPH.initModel();
        megaton_hammer.initModel();

    }

    @Optional.Method(modid = "baubles")
    @SideOnly(Side.CLIENT)
    public static void initAPIModels(){
        gorons_bracelet.initModel();
        return;
    }
}

 

ModEntities:

Spoiler

package com.cruelar.cruelars_triforcemod.init;

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.entities.EntityBombPrimed;
import com.cruelar.cruelars_triforcemod.entities.boss.*;
import com.cruelar.cruelars_triforcemod.entities.monster.*;
import com.cruelar.cruelars_triforcemod.entities.passive.Fairy;
import com.cruelar.cruelars_triforcemod.entities.projectiles.*;
import com.cruelar.cruelars_triforcemod.renderer.*;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.init.Biomes;
import net.minecraft.world.storage.loot.LootTableList;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class ModEntities {

    public static void init(){
        int id = 1;
        EntityRegistry.registerModEntity(Bokoblin.RESOURCE_LOCATION,Bokoblin.class, "cruelars_triforcemod:bokoblin", id++, Cruelars_Triforcemod_Core.instance, 64, 3, true, 0xee461c, 0x95260b);
        EntityRegistry.addSpawn(Bokoblin.class,100, 3, 5, EnumCreatureType.MONSTER,Biomes.BEACH,Biomes.PLAINS,Biomes.FOREST,Biomes.FOREST_HILLS,Biomes.BIRCH_FOREST,Biomes.BIRCH_FOREST_HILLS,Biomes.JUNGLE,Biomes.JUNGLE_EDGE,Biomes.JUNGLE_HILLS,Biomes.RIVER,Biomes.ROOFED_FOREST,Biomes.SAVANNA,Biomes.SAVANNA_PLATEAU);
        LootTableList.register(Bokoblin.LOOT);
        EntityRegistry.registerModEntity(Blue_Bokoblin.RESOURCE_LOCATION,Blue_Bokoblin.class, "cruelars_triforcemod:blue_bokoblin", id++, Cruelars_Triforcemod_Core.instance, 64, 3, true, 0x457c92, 0x2c4f5c);
        EntityRegistry.addSpawn(Blue_Bokoblin.class,50, 0, 3, EnumCreatureType.MONSTER,Biomes.BEACH,Biomes.PLAINS,Biomes.FOREST,Biomes.FOREST_HILLS,Biomes.BIRCH_FOREST,Biomes.BIRCH_FOREST_HILLS,Biomes.JUNGLE,Biomes.JUNGLE_EDGE,Biomes.JUNGLE_HILLS,Biomes.RIVER,Biomes.ROOFED_FOREST,Biomes.SAVANNA,Biomes.SAVANNA_PLATEAU,Biomes.COLD_BEACH,Biomes.COLD_TAIGA,Biomes.COLD_TAIGA_HILLS,Biomes.DESERT,Biomes.DESERT_HILLS,Biomes.FROZEN_OCEAN,Biomes.FROZEN_RIVER,Biomes.ICE_MOUNTAINS,Biomes.ICE_PLAINS,Biomes.REDWOOD_TAIGA,Biomes.REDWOOD_TAIGA_HILLS);
        LootTableList.register(Blue_Bokoblin.LOOT);
        EntityRegistry.registerModEntity(Black_Bokoblin.RESOURCE_LOCATION,Black_Bokoblin.class, "cruelars_triforcemod:black_bokoblin", id++, Cruelars_Triforcemod_Core.instance, 64, 3, true, 0x483224, 0x322318);
        EntityRegistry.addSpawn(Black_Bokoblin.class,25, 0, 2, EnumCreatureType.MONSTER,Biomes.COLD_BEACH,Biomes.COLD_TAIGA,Biomes.COLD_TAIGA_HILLS,Biomes.DESERT,Biomes.DESERT_HILLS,Biomes.FROZEN_OCEAN,Biomes.FROZEN_RIVER,Biomes.ICE_MOUNTAINS,Biomes.ICE_PLAINS,Biomes.REDWOOD_TAIGA,Biomes.REDWOOD_TAIGA_HILLS);
        LootTableList.register(Black_Bokoblin.LOOT);
        EntityRegistry.registerModEntity(Ganondorf.RESOURCE_LOCATION,Ganondorf.class, "cruelars_triforcemod:ganondorf", id++, Cruelars_Triforcemod_Core.instance, 64, 3, true, 0x272727, 0xd8bb49);
        EntityRegistry.registerModEntity(EntityIceArrow.RESOURCE_LOCATION,EntityIceArrow.class,"cruelars_triforcemod:ice_arrow",id++,Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(EntityBombArrow.RESOURCE_LOCATION,EntityBombArrow.class,"cruelars_triforcemod:bomb_arrow",id++,Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(EntityShockArrow.RESOURCE_LOCATION,EntityShockArrow.class,"cruelars_triforcemod:shock_arrow",id++,Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(EntityFireArrow.RESOURCE_LOCATION,EntityFireArrow.class,"cruelars_triforcemod:fire_arrow",id++,Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(Stone_Talus.RESOURCE_LOCATION,Stone_Talus.class,"cruelars_triforcemod:stone_talus",id++,Cruelars_Triforcemod_Core.instance,64,3,true,0x996600,0x00ff01);
        EntityRegistry.addSpawn(Stone_Talus.class,10,0,1,EnumCreatureType.MONSTER,Biomes.STONE_BEACH,Biomes.EXTREME_HILLS,Biomes.EXTREME_HILLS_EDGE,Biomes.EXTREME_HILLS_WITH_TREES,Biomes.MUTATED_EXTREME_HILLS,Biomes.MUTATED_EXTREME_HILLS_WITH_TREES);
        EntityRegistry.registerModEntity(MajorasMask.RESOURCE_LOCATION,MajorasMask.class, "cruelars_triforcemod:majorasmask", id++, Cruelars_Triforcemod_Core.instance, 64, 3, true, 0x996600, 0x00ff00);
        EntityRegistry.registerModEntity(EntityBombPrimed.RESOURCE_LOCATION,EntityBombPrimed.class,"cruelars_triforcemod:entitybombprimed",id++, Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(EntityBomb.RESOURCE_LOCATION,EntityBomb.class,"cruelars_triforcemod:entitybomb",id++, Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(Clawshot_Head.RESOURCE_LOCATION,Clawshot_Head.class,"cruelars_triforcemod:clawshot_head",id++,Cruelars_Triforcemod_Core.instance,64,3,true);
        EntityRegistry.registerModEntity(Fairy.RESOURCE_LOCATION,Fairy.class,"cruelars_triforcemod:fairy",id++,Cruelars_Triforcemod_Core.instance,32,4,true,0xffaec9,0xe2f5fa);

    }

    @SideOnly(Side.CLIENT)
    public static void initModels(){
        RenderingRegistry.registerEntityRenderingHandler(Bokoblin.class, RenderBokoblin.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Ganondorf.class, RenderGanondorf.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Blue_Bokoblin.class, RenderBlue_Bokoblin.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Black_Bokoblin.class, RenderBlack_Bokoblin.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityIceArrow.class,RenderIceArrow.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityBombArrow.class, RenderBombArrow.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityShockArrow.class,RenderShockArrow.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityFireArrow.class, RenderFireArrow.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Stone_Talus.class,RenderStoneTalus.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(MajorasMask.class,RenderMajorasMask.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityBombPrimed.class,RenderBombPrimed.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(EntityBomb.class,RenderBomb.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Clawshot_Head.class,RenderClawshot.FACTORY);
        RenderingRegistry.registerEntityRenderingHandler(Fairy.class,RenderFairy.FACTORY);
    }
}

 

Clawshot_TP:

Spoiler

package com.cruelar.cruelars_triforcemod.items;

import com.cruelar.cruelars_triforcemod.Cruelars_Triforcemod_Core;
import com.cruelar.cruelars_triforcemod.entities.projectiles.Clawshot_Head;
import com.cruelar.cruelars_triforcemod.inventory.cruelars_triforcemod;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nullable;
import java.util.Objects;

public class Clawshot_TP extends Item {

    public Clawshot_TP(){
        this.setCreativeTab(cruelars_triforcemod.CRUELARS_TRIFORCEMOD);
        this.setRegistryName("clawshot_tp");
        this.setUnlocalizedName(Cruelars_Triforcemod_Core.MODID+".clawshot_tp");
        this.addPropertyOverride(new ResourceLocation("cast"), new IItemPropertyGetter() {
            @SideOnly(Side.CLIENT)
            public float apply(ItemStack p_apply_1_, @Nullable World p_apply_2_, @Nullable EntityLivingBase p_apply_3_) {
                if (p_apply_3_ == null) {
                    return 0.0F;
                } else {
                    boolean lvt_4_1_ = p_apply_3_.getHeldItemMainhand() == p_apply_1_;
                    boolean lvt_5_1_ = p_apply_3_.getHeldItemOffhand() == p_apply_1_;
                    if (p_apply_3_.getHeldItemMainhand().getItem() instanceof Clawshot_TP) {
                        lvt_5_1_ = false;
                    }

                    return (lvt_4_1_ || lvt_5_1_) && p_apply_3_ instanceof EntityPlayer && ((EntityPlayer)p_apply_3_).fishEntity != null ? 1.0F : 0.0F;
                }
            }
        });
    }

    @Override
    public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer entityPlayer,EnumHand enumHand) {
        ItemStack itemStack = entityPlayer.getHeldItem(enumHand);
        Clawshot_Head clawshot_head = new Clawshot_Head(world, entityPlayer);
        if (!world.isRemote) {
            if (this.getTagCompoundSafe(itemStack).getInteger("head")==0 || Objects.requireNonNull(world.getEntityByID(this.getTagCompoundSafe(itemStack).getInteger("head"))).isDead) {
                world.spawnEntity(clawshot_head);
                this.getTagCompoundSafe(itemStack).setBoolean("shot",true);
                this.getTagCompoundSafe(itemStack).setInteger("head",clawshot_head.getEntityId());
            } else {
                clawshot_head.setDead();
                this.getTagCompoundSafe(itemStack).setBoolean("shot",false);
                this.getTagCompoundSafe(itemStack).setInteger("head",0);
            }
        }
        return new ActionResult(EnumActionResult.SUCCESS,itemStack);
    }

    @SideOnly(Side.CLIENT)
    public void initModel(){
        ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(Objects.requireNonNull(getRegistryName()), "inventory"));
    }

    private NBTTagCompound getTagCompoundSafe(ItemStack stack) {
        NBTTagCompound tagCompound = stack.getTagCompound();
        if (tagCompound == null) {
            tagCompound = new NBTTagCompound();
            stack.setTagCompound(tagCompound);
        }
        return tagCompound;
    }
}

 

Clawshot_Head:

Spoiler

package com.cruelar.cruelars_triforcemod.entities.projectiles;

import io.netty.buffer.ByteBuf;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.*;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import java.util.Iterator;
import java.util.List;

public class Clawshot_Head extends Entity implements IEntityAdditionalSpawnData{
    private EntityPlayer entityPlayer;
    public Entity caughtEntity;
    public Clawshot_Head.State currentState;
    private static final DataParameter<Integer> DATA_HOOKED_ENTITY;
    private boolean inGround;
    private int ticksInAir;
    private int ticksInGround;
    private boolean shouldRetarct=false;
    public static ResourceLocation RESOURCE_LOCATION=new ResourceLocation("cruelars_triforcemod:textures/entity/projectiles/clawshot_head.png");

    public Clawshot_Head(World world){
        super(world);
    }

    public Clawshot_Head(World world, EntityPlayer entityPlayer){
        super(world);
        this.init(entityPlayer);
        this.currentState = Clawshot_Head.State.FLYING;
        this.setPosition((double)entityPlayer.posX,(double)entityPlayer.posY+entityPlayer.getEyeHeight(),(double)entityPlayer.posZ);
        this.shoot(entityPlayer);
    }

    @SideOnly(Side.CLIENT)
    public Clawshot_Head(World world, EntityPlayer entityPlayer, double posX, double posY, double posZ) {
        super(world);
        this.init(entityPlayer);
        this.setPosition(posX,posY,posZ);
        this.prevPosX = this.posX;
        this.prevPosY = this.posY;
        this.prevPosZ = this.posZ;
    }

    public void notifyDataManagerChange(DataParameter<?> p_notifyDataManagerChange_1_) {
        if (DATA_HOOKED_ENTITY.equals(p_notifyDataManagerChange_1_)) {
            int i = (Integer)this.getDataManager().get(DATA_HOOKED_ENTITY);
            this.caughtEntity = i > 0 ? this.world.getEntityByID(i - 1) : null;
        }

        super.notifyDataManagerChange(p_notifyDataManagerChange_1_);
    }

    public void onUpdate()
    {
        super.onUpdate();

        if (this.entityPlayer == null)
        {
            this.setDead();
        }
        else if (this.world.isRemote )
        {
            if (this.inGround)
            {
                ++this.ticksInGround;

                if (this.ticksInGround >= 1200)
                {
                    this.setDead();
                    return;
                }
            }
            if(this.getDistance(entityPlayer)>=64){
                this.setDead();
            }
            BlockPos blockpos = new BlockPos(this);
            IBlockState iblockstate = this.world.getBlockState(blockpos);
            if (this.currentState == Clawshot_Head.State.FLYING)
            {
                if (this.caughtEntity != null)
                {
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                    this.currentState = Clawshot_Head.State.HOOKED_IN_ENTITY;
                    return;
                }

                if (!this.world.isRemote)
                {
                    this.checkCollision();
                }

                if (!this.inGround && !this.onGround && !this.collidedHorizontally)
                {
                    ++this.ticksInAir;
                }
                else
                {
                    this.ticksInAir = 0;
                    this.motionX = 0.0D;
                    this.motionY = 0.0D;
                    this.motionZ = 0.0D;
                }
                if (ticksInAir>=100){
                    this.shouldRetarct=true;
                }
            }
            else
            {
                if (this.currentState == Clawshot_Head.State.HOOKED_IN_ENTITY)
                {
                    if (this.caughtEntity != null)
                    {
                        if (this.caughtEntity.isDead)
                        {
                            this.caughtEntity = null;
                            this.currentState = Clawshot_Head.State.FLYING;
                        }
                        else
                        {
                            this.posX = this.caughtEntity.posX;
                            double d2 = (double)this.caughtEntity.height;
                            this.posY = this.caughtEntity.getEntityBoundingBox().minY + d2 * 0.8D;
                            this.posZ = this.caughtEntity.posZ;
                            this.setPosition(this.posX, this.posY, this.posZ);
                        }
                    }

                    return;
                }
            }

            this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
            this.updateRotation();
            this.setPosition(this.posX, this.posY, this.posZ);
        }
    }

    private void updateRotation()
    {
        float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
        this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI));

        for (this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
        {
            ;
        }

        while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
        {
            this.prevRotationPitch += 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw < -180.0F)
        {
            this.prevRotationYaw -= 360.0F;
        }

        while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
        {
            this.prevRotationYaw += 360.0F;
        }

        this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
        this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
    }

    public void shoot(Entity entity) {
        System.out.println(entity);
        this.motionX=0.6D*entity.getLookVec().x;
        this.motionY=0.6D*entity.getLookVec().y;
        this.motionZ=0.6D*entity.getLookVec().z;

    }

    public void shoot(double p_shoot_1_, double p_shoot_3_, double p_shoot_5_, float p_shoot_7_, float p_shoot_8_){}

    public int handleHookRetraction()
    {
        if (!this.world.isRemote && this.entityPlayer != null)
        {
            int i = 0;
            if (this.caughtEntity != null)
            {
                this.bringInHookedEntity();
                this.world.setEntityState(this, (byte)31);
                i = this.caughtEntity instanceof EntityItem ? 3 : 5;
            }
            else if (this.inGround)
            {
                i = 2;
            }

            this.setDead();
            return i;
        }
        else
        {
            return 0;
        }
    }

    protected void bringInHookedEntity()
    {
        if (this.entityPlayer != null)
        {
            double d0 = this.entityPlayer.posX - this.posX;
            double d1 = this.entityPlayer.posY - this.posY;
            double d2 = this.entityPlayer.posZ - this.posZ;
            double d3 = 0.1D;
            this.caughtEntity.motionX += d0 * 0.1D;
            this.caughtEntity.motionY += d1 * 0.1D;
            this.caughtEntity.motionZ += d2 * 0.1D;
        }
    }

    public void setDead()
    {
        super.setDead();
    }

    public EntityPlayer getAngler()
    {
        return this.entityPlayer;
    }

    private void init(EntityPlayer p_init_1_) {
        this.setSize(0.25F, 0.25F);
        this.ignoreFrustumCheck = true;
        this.entityPlayer = p_init_1_;
    }

    private void checkCollision() {
        Vec3d vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        Vec3d vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        RayTraceResult raytraceresult = this.world.rayTraceBlocks(vec3d, vec3d1, false, true, false);
        vec3d = new Vec3d(this.posX, this.posY, this.posZ);
        vec3d1 = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
        if (raytraceresult != null) {
            vec3d1 = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y, raytraceresult.hitVec.z);
            this.motionX=0;
            this.motionY=0;
            this.motionZ=0;
            entityPlayer.posX=this.posX;
            entityPlayer.posY=this.posY;
            entityPlayer.posZ=this.posZ;
        }

        Entity entity = null;
        List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
        double d0 = 0.0D;
        Iterator var8 = list.iterator();

        while(true) {
            Entity entity1;
            double d1;
            do {
                RayTraceResult raytraceresult1;
                do {
                    do {
                        do {
                            if (!var8.hasNext()) {
                                if (entity != null) {
                                    raytraceresult = new RayTraceResult(entity);
                                }

                                if (raytraceresult != null && raytraceresult.typeOfHit != RayTraceResult.Type.MISS) {
                                    if (raytraceresult.typeOfHit == RayTraceResult.Type.ENTITY) {
                                        this.caughtEntity = raytraceresult.entityHit;
                                        this.setHookedEntity();
                                    } else {
                                        this.inGround = true;
                                    }
                                }

                                return;
                            }

                            entity1 = (Entity)var8.next();
                        } while(!this.canBeHooked(entity1));
                    } while(entity1 == this.entityPlayer && this.ticksInAir < 5);

                    AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().grow(0.30000001192092896D);
                    raytraceresult1 = axisalignedbb.calculateIntercept(vec3d, vec3d1);
                } while(raytraceresult1 == null);

                d1 = vec3d.squareDistanceTo(raytraceresult1.hitVec);
            } while(d1 >= d0 && d0 != 0.0D);

            entity = entity1;
            d0 = d1;
        }
    }

    private void setHookedEntity() {
        this.getDataManager().set(DATA_HOOKED_ENTITY, this.caughtEntity.getEntityId() + 1);
    }

    protected boolean canBeHooked(Entity p_canBeHooked_1_) {
        return p_canBeHooked_1_.canBeCollidedWith() || p_canBeHooked_1_ instanceof EntityItem;
    }

    protected void entityInit() {
        this.getDataManager().register(DATA_HOOKED_ENTITY, 0);
    }

    @Override
    protected void readEntityFromNBT(NBTTagCompound nbtTagCompound) {

    }

    @Override
    protected void writeEntityToNBT(NBTTagCompound nbtTagCompound) {

    }

    static {
        DATA_HOOKED_ENTITY = EntityDataManager.createKey(Clawshot_Head.class, DataSerializers.VARINT);
    }

    @Override
    public void writeSpawnData(ByteBuf buffer) {
        buffer.writeBoolean(entityPlayer==null);
        if (entityPlayer!=null) {
            buffer.writeInt(entityPlayer.getEntityId());
        }
    }

    @Override
    public void readSpawnData(ByteBuf additionalData) {
        boolean nullPlayer = additionalData.readBoolean();
        if (!nullPlayer){
            EntityPlayer entityByID=(EntityPlayer) world.getEntityByID(additionalData.readInt());
            if (entityByID!=null){
                entityPlayer=entityByID;
            }
            this.shoot(entityPlayer);
        }
    }

    static enum State {
        FLYING,
        HOOKED_IN_ENTITY;

        private State() {
        }
    }
}

 

And this Post is the perfect example why you should use GitHub, but as I said currently having Problems with it.

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

5 minutes ago, diesieben07 said:

mess of copy-pasta code.

As Animefan8888's signature says Vanilla code is the best resource. ?

But I know what you mean.

10 minutes ago, diesieben07 said:

This is broken. Entity IDs are not persistent and solely for network use. You must use the UUID.

Is this also false? Or is this Networking 'cause I'm a bit confused about networking. WIll look into the docs.

@Override
    public void writeSpawnData(ByteBuf buffer) {
        buffer.writeBoolean(entityPlayer==null);
        if (entityPlayer!=null) {
            buffer.writeInt(entityPlayer.getEntityId());
        }
    }

    @Override
    public void readSpawnData(ByteBuf additionalData) {
        boolean nullPlayer = additionalData.readBoolean();
        if (!nullPlayer){
            EntityPlayer entityByID=(EntityPlayer) world.getEntityByID(additionalData.readInt());
            if (entityByID!=null){
                entityPlayer=entityByID;
            }
            this.shoot(entityPlayer);
        }
    }

 

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)

 

Important:

As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

4 minutes ago, _Cruelar_ said:

As Animefan8888's signature says Vanilla code is the best resource. ?

But I know what you mean.

I didn't mean it like that, its meant more as a learning apparatus to understand how one might be able to do something, although forge adds some changes. IE Block#hasTileEntity/Block#createTileEntity with ITileEntityProvider/BlockContainer.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have made a post shader with all of it's files (in post and program) being finished, it's just an edited creeper post shader for now. How do I load it ingame?  Minecraft.getInstance().gameRenderer.loadEffect(new ResourceLocation("thedefused:shaders/post/creep.json")); This just gives an error due to it trying to find program in minecraft:shaders/program However, I have seen multiple mods use post shaders. how?
    • Hello. I've been having a problem when launching minecraft forge. It just doesn't open the game, and leaves me with this "(exit code 1)" error. Both regular and optifine versions of minecraft launch just fine, tried both with 1.18.2 and 1.20.1. I can assure that my drivers are updated so that can't be it, and i've tried using Java 17, 18 and 21 to no avail. Even with no mods installed, the thing won't launch. I'll leave the log here, although it's in spanish: https://jmp.sh/s/FPqGBSi30fzKJDt2M1gc My specs are this: Ryzen 3 4100 || Radeon R9 280x || 16gb ram || Windows 10 I'd appreciate any help, thank you in advance.
    • Hey, Me and my friends decided to start up a Server with "a few" mods, the last few days everything went well we used all the items we wanted. Now our Game crashes the moment we touch a Lava Bucket inside our Inventory. It just instantly closes and gives me an "Alc Cleanup"  Crash screen (Using GDLauncher). I honestly dont have a clue how to resolve this error. If anyone could help id really appreciate it, I speak German and Englisch so you can choose whatever you speak more fluently. Thanks in Advance. Plus I dont know how to link my Crash Report help for that would be nice too whoops
    • I hosted a minecraft server and I modded it, and there is always an error on the console which closes the server. If someone knows how to repair it, it would be amazing. Thank you. I paste the crash report down here: ---- Minecraft Crash Report ---- WARNING: coremods are present:   llibrary (llibrary-core-1.0.11-1.12.2.jar)   WolfArmorCore (WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar)   AstralCore (astralsorcery-1.12.2-1.10.27.jar)   CreativePatchingLoader (CreativeCore_v1.10.71_mc1.12.2.jar)   SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.8.jar)   ForgelinPlugin (Forgelin-1.8.4.jar)   midnight (themidnight-0.3.5.jar)   FutureMC (Future-MC-0.2.19.jar)   SpartanWeaponry-MixinLoader (SpartanWeaponry-1.12.2-1.5.3.jar)   Backpacked (backpacked-1.4.3-1.12.2.jar)   LoadingPlugin (Reskillable-1.12.2-1.13.0.jar)   LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar) Contact their authors BEFORE contacting forge // There are four lights! Time: 3/28/24 12:17 PM Description: Exception in server tick loop net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient     at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:89)     at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:612)     at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:498)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:595)     at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98)     at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333)     at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)     at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient     at java.lang.Class.getDeclaredMethods0(Native Method)     at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)     at java.lang.Class.privateGetPublicMethods(Class.java:2902)     at java.lang.Class.getMethods(Class.java:1615)     at net.minecraftforge.fml.common.eventhandler.EventBus.register(EventBus.java:82)     at net.minecraftforge.fml.common.AutomaticEventSubscriber.inject(AutomaticEventSubscriber.java:82)     ... 31 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.multiplayer.WorldClient     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:418)     at java.lang.ClassLoader.loadClass(ClassLoader.java:351)     ... 37 more Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@4e558728 from coremod FMLCorePlugin     at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260)     at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)     ... 39 more Caused by: java.lang.RuntimeException: Attempted to load class bsb for invalid side SERVER     at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62)     at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256)     ... 41 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Linux (amd64) version 5.10.0-28-cloud-amd64     Java Version: 1.8.0_382, Temurin     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Temurin     Memory: 948745536 bytes (904 MB) / 1564999680 bytes (1492 MB) up to 7635730432 bytes (7282 MB)     JVM Flags: 2 total; -Xmx8192M -Xms256M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2860 63 mods loaded, 63 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                 | Version                 | Source                                                | Signature                                |     |:----- |:------------------ |:----------------------- |:----------------------------------------------------- |:---------------------------------------- |     | LC    | minecraft          | 1.12.2                  | minecraft.jar                                         | None                                     |     | LC    | mcp                | 9.42                    | minecraft.jar                                         | None                                     |     | LC    | FML                | 8.0.99.99               | forge-1.12.2-14.23.5.2860.jar                         | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | forge              | 14.23.5.2860            | forge-1.12.2-14.23.5.2860.jar                         | e3c3d50c7c986df74c645c0ac54639741c90a557 |     | LC    | creativecoredummy  | 1.0.0                   | minecraft.jar                                         | None                                     |     | LC    | backpacked         | 1.4.2                   | backpacked-1.4.3-1.12.2.jar                           | None                                     |     | LC    | itemblacklist      | 1.4.3                   | ItemBlacklist-1.4.3.jar                               | None                                     |     | LC    | securitycraft      | v1.9.8                  | [1.12.2] SecurityCraft v1.9.8.jar                     | None                                     |     | LC    | aiimprovements     | 0.0.1.3                 | AIImprovements-1.12-0.0.1b3.jar                       | None                                     |     | LC    | jei                | 4.16.1.301              | jei_1.12.2-4.16.1.301.jar                             | None                                     |     | LC    | appleskin          | 1.0.14                  | AppleSkin-mc1.12-1.0.14.jar                           | None                                     |     | LC    | baubles            | 1.5.2                   | Baubles-1.12-1.5.2.jar                                | None                                     |     | LC    | astralsorcery      | 1.10.27                 | astralsorcery-1.12.2-1.10.27.jar                      | a0f0b759d895c15ceb3e3bcb5f3c2db7c582edf0 |     | LC    | attributefix       | 1.0.12                  | AttributeFix-Forge-1.12.2-1.0.12.jar                  | None                                     |     | LC    | atum               | 2.0.20                  | Atum-1.12.2-2.0.20.jar                                | None                                     |     | LC    | bloodmoon          | 1.5.3                   | Bloodmoon-MC1.12.2-1.5.3.jar                          | d72e0dd57935b3e9476212aea0c0df352dd76291 |     | LC    | forgelin           | 1.8.4                   | Forgelin-1.8.4.jar                                    | None                                     |     | LC    | bountiful          | 2.2.2                   | Bountiful-2.2.2.jar                                   | None                                     |     | LC    | camera             | 1.0.10                  | camera-1.0.10.jar                                     | None                                     |     | LC    | chisel             | MC1.12.2-1.0.2.45       | Chisel-MC1.12.2-1.0.2.45.jar                          | None                                     |     | LC    | collective         | 3.0                     | collective-1.12.2-3.0.jar                             | None                                     |     | LC    | reskillable        | 1.12.2-1.13.0           | Reskillable-1.12.2-1.13.0.jar                         | None                                     |     | LC    | compatskills       | 1.12.2-1.17.0           | CompatSkills-1.12.2-1.17.0.jar                        | None                                     |     | LC    | creativecore       | 1.10.0                  | CreativeCore_v1.10.71_mc1.12.2.jar                    | None                                     |     | LC    | customnpcs         | 1.12                    | CustomNPCs_1.12.2-(05Jul20).jar                       | None                                     |     | LC    | darknesslib        | 1.1.2                   | DarknessLib-1.12.2-1.1.2.jar                          | 220f10d3a93b3ff5fbaa7434cc629d863d6751b9 |     | LC    | dungeonsmod        | @VERSION@               | DungeonsMod-1.12.2-1.0.8.jar                          | None                                     |     | LC    | enhancedvisuals    | 1.3.0                   | EnhancedVisuals_v1.4.4_mc1.12.2.jar                   | None                                     |     | LC    | extrautils2        | 1.0                     | extrautils2-1.12-1.9.9.jar                            | None                                     |     | LC    | futuremc           | 0.2.6                   | Future-MC-0.2.19.jar                                  | None                                     |     | LC    | geckolib3          | 3.0.30                  | geckolib-forge-1.12.2-3.0.31.jar                      | None                                     |     | LC    | gottschcore        | 1.15.1                  | GottschCore-mc1.12.2-f14.23.5.2859-v1.15.1.jar        | None                                     |     | LC    | hardcorerevival    | 1.2.0                   | HardcoreRevival_1.12.2-1.2.0.jar                      | None                                     |     | LC    | waila              | 1.8.26                  | Hwyla-1.8.26-B41_1.12.2.jar                           | None                                     |     | LE    | imsm               | 1.12                    | Instant Massive Structures Mod 1.12.2.jar             | None                                     |     | L     | journeymap         | 1.12.2-5.7.1p2          | journeymap-1.12.2-5.7.1p2.jar                         | None                                     |     | L     | mobsunscreen       | @version@               | mobsunscreen-1.12.2-3.1.5.jar                         | None                                     |     | L     | morpheus           | 1.12.2-3.5.106          | Morpheus-1.12.2-3.5.106.jar                           | None                                     |     | L     | llibrary           | 1.7.20                  | llibrary-1.7.20-1.12.2.jar                            | None                                     |     | L     | mowziesmobs        | 1.5.8                   | mowziesmobs-1.5.8.jar                                 | None                                     |     | L     | nocubessrparmory   | 3.0.0                   | NoCubes_SRP_Combat_Addon_3.0.0.jar                    | None                                     |     | L     | nocubessrpnests    | 3.0.0                   | NoCubes_SRP_Nests_Addon_3.0.0.jar                     | None                                     |     | L     | nocubessrpsurvival | 3.0.0                   | NoCubes_SRP_Survival_Addon_3.0.0.jar                  | None                                     |     | L     | nocubesrptweaks    | V4.1                    | nocubesrptweaks-V4.1.jar                              | None                                     |     | L     | patchouli          | 1.0-23.6                | Patchouli-1.0-23.6.jar                                | None                                     |     | L     | artifacts          | 1.1.2                   | RLArtifacts-1.1.2.jar                                 | None                                     |     | L     | rsgauges           | 1.2.8                   | rsgauges-1.12.2-1.2.8.jar                             | None                                     |     | L     | rustic             | 1.1.7                   | rustic-1.1.7.jar                                      | None                                     |     | L     | silentlib          | 3.0.13                  | SilentLib-1.12.2-3.0.14+168.jar                       | None                                     |     | L     | scalinghealth      | 1.3.37                  | ScalingHealth-1.12.2-1.3.42+147.jar                   | None                                     |     | L     | lteleporters       | 1.12.2-3.0.2            | simpleteleporters-1.12.2-3.0.2.jar                    | None                                     |     | L     | spartanshields     | 1.5.5                   | SpartanShields-1.12.2-1.5.5.jar                       | None                                     |     | L     | spartanweaponry    | 1.5.3                   | SpartanWeaponry-1.12.2-1.5.3.jar                      | None                                     |     | L     | srparasites        | 1.9.18                  | SRParasites-1.12.2v1.9.18.jar                         | None                                     |     | L     | treasure2          | 2.2.0                   | Treasure2-mc1.12.2-f14.23.5.2859-v2.2.1.jar           | None                                     |     | L     | treeharvester      | 4.0                     | treeharvester_1.12.2-4.0.jar                          | None                                     |     | L     | twilightforest     | 3.11.1021               | twilightforest-1.12.2-3.11.1021-universal.jar         | None                                     |     | L     | variedcommodities  | 1.12.2                  | VariedCommodities_1.12.2-(31Mar23).jar                | None                                     |     | L     | voicechat          | 1.12.2-2.4.32           | voicechat-forge-1.12.2-2.4.32.jar                     | None                                     |     | L     | wolfarmor          | 3.8.0                   | WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar | None                                     |     | L     | worldborder        | 2.3                     | worldborder_1.12.2-2.3.jar                            | None                                     |     | L     | midnight           | 0.3.5                   | themidnight-0.3.5.jar                                 | None                                     |     | L     | structurize        | 1.12.2-0.10.277-RELEASE | structurize-1.12.2-0.10.277-RELEASE.jar               | None                                     |     Loaded coremods (and transformers):  llibrary (llibrary-core-1.0.11-1.12.2.jar)   net.ilexiconn.llibrary.server.core.plugin.LLibraryTransformer   net.ilexiconn.llibrary.server.core.patcher.LLibraryRuntimePatcher WolfArmorCore (WolfArmorAndStorage-1.12.2-3.8.0-universal-signed.jar)    AstralCore (astralsorcery-1.12.2-1.10.27.jar)    CreativePatchingLoader (CreativeCore_v1.10.71_mc1.12.2.jar)    SecurityCraftLoadingPlugin ([1.12.2] SecurityCraft v1.9.8.jar)    ForgelinPlugin (Forgelin-1.8.4.jar)    midnight (themidnight-0.3.5.jar)   com.mushroom.midnight.core.transformer.MidnightClassTransformer FutureMC (Future-MC-0.2.19.jar)   thedarkcolour.futuremc.asm.CoreTransformer SpartanWeaponry-MixinLoader (SpartanWeaponry-1.12.2-1.5.3.jar)    Backpacked (backpacked-1.4.3-1.12.2.jar)   com.mrcrayfish.backpacked.asm.BackpackedTransformer LoadingPlugin (Reskillable-1.12.2-1.13.0.jar)   codersafterdark.reskillable.base.asm.ClassTransformer LoadingPlugin (Bloodmoon-MC1.12.2-1.5.3.jar)   lumien.bloodmoon.asm.ClassTransformer     Profiler Position: N/A (disabled)     Is Modded: Definitely; Server brand changed to 'fml,forge'     Type: Dedicated Server (map_server.txt)
    • When i add mods like falling leaves, visuality and kappas shaders, even if i restart Minecraft they dont show up in the mods menu and they dont work
  • Topics

×
×
  • Create New...

Important Information

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