Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.10] add Texture to new Arrow-Entity
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
Abrynos

[1.7.10] add Texture to new Arrow-Entity

By Abrynos, February 28, 2015 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Abrynos    2

Abrynos

Abrynos    2

  • Creeper Killer
  • Abrynos
  • Members
  • 2
  • 124 posts
Posted February 28, 2015

Like the title says it i want to add a texture to my new EntityEnderArrow; The code is below:

 

public class EntityEnderArrow extends EntityThrowable {

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

public EntityEnderArrow(World world, EntityLivingBase entityliving){
	super(world, entityliving);
	this.setSize(0.5F, 0.5F);
}

@SideOnly(Side.CLIENT)
public EntityEnderArrow(World world, double d1, double d2, double d3){
	super(world, d1, d2, d3);
	this.setSize(0.5F, 0.5F);
}

@Override
public void onImpact(MovingObjectPosition pos){
	if(pos.entityHit != null){
		pos.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
	}

	for(int i = 0; i < 32; ++i){
		this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(),  0.0D, this.rand.nextGaussian());
	}

	if(!this.worldObj.isRemote){
		if(this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP){
			EntityPlayerMP player = (EntityPlayerMP)this.getThrower();

			if(player.playerNetServerHandler.func_147362_b().isChannelOpen() && player.worldObj == this.worldObj){
				EnderTeleportEvent event = new EnderTeleportEvent(player, this.posX, this.posY, this.posZ, 5.0F);
				if(!MinecraftForge.EVENT_BUS.post(event)){
					if(this.getThrower().isRiding()){
						this.getThrower().mountEntity((Entity)null);
					}

					this.getThrower().setPositionAndUpdate(event.targetX, event.targetY, event.targetZ);
					this.getThrower().fallDistance = 0.0F;
				}
			}
		}
		this.setDead();
	}
}
}

  • Quote

Share this post


Link to post
Share on other sites

Abrynos    2

Abrynos

Abrynos    2

  • Creeper Killer
  • Abrynos
  • Members
  • 2
  • 124 posts
Posted March 14, 2015

still no answer :/

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7699

diesieben07

diesieben07    7699

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7699
  • 56430 posts
Posted March 14, 2015

You need a renderer like for any other entity.

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • troublemaker_47
      TeleportCommand Help

      By troublemaker_47 · Posted 1 hour ago

      Hello, I am a beginner minecraft modder and i have some problems with a bit of code that would teleport the player in the direction he's facing.can anyone tell me How to merge these lines together: player.getLookVec().scale(2.0F).add(player.getPositionVec()); TeleportCommand;   P.S: i need this to work in minecraft 1.16.5-36.0.15
    • skeletal
      unable to connect to my server

      By skeletal · Posted 1 hour ago

      hello, every time i try to join my modded server i get the "fatally missing registry entries" error and the "minecraft:wheat (net.minecraft.crafting.shapedrecipies) produces unregistered item minecraft:wheat" error and i dont know what to do, any help would be appreciated here is a screenshot of the console when i try to join:
    • <Gl33p_0r4nge>
      [1.16.4] Screen Render

      By <Gl33p_0r4nge> · Posted 2 hours ago

      Okay I see that no one probably know how but can you at least tell me where should I get the rendered player view?  
    • Luis_ST
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST · Posted 3 hours ago

      I don't know what code I would still be helpful, so here are the relevant classes in my git repo: TextureStitchEvent: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/other/OnTextureStitchEvent.java BackpackContainer (with custom slot subclass): https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/common/inventory/container/BackpackContainer.java   I think I understood after trying something: my message class requires 3 methods (encode, decode, handle) which I then have to specify when registering the message (parameter 3 - 6). Am I right?
    • troublemaker_47
      Teleport player in same direction as where he looks

      By troublemaker_47 · Posted 4 hours ago

      Can you please tell me how to use the teleportcommand method or its syntax. @diesieben07
  • Topics

    • troublemaker_47
      0
      TeleportCommand Help

      By troublemaker_47
      Started 1 hour ago

    • skeletal
      0
      unable to connect to my server

      By skeletal
      Started 1 hour ago

    • <Gl33p_0r4nge>
      1
      [1.16.4] Screen Render

      By <Gl33p_0r4nge>
      Started Monday at 02:58 PM

    • Luis_ST
      9
      [1.16.5] Help with custom Backpack (slot background and mouse wheel move)

      By Luis_ST
      Started Wednesday at 07:47 AM

    • troublemaker_47
      7
      Teleport player in same direction as where he looks

      By troublemaker_47
      Started 21 hours ago

  • Who's Online (See full list)

    • <Gl33p_0r4nge>
    • brok4d
    • DmitryLovin
    • Luis_ST
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.7.10] add Texture to new Arrow-Entity
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community