robertcarr22
-
Posts
8 -
Joined
-
Last visited
Posts posted by robertcarr22
-
-
Because your xMax is less than your xMin (ditto for z).
oh… arg that means i need to think of another way of doing this any suggestions on how to get a bounding box so that the entity the player is pointing at gets selected?
EDIT: nevermind figured something out!
-
The two params are:
1) The entity class you are interested in.
2) An axis aligned bounding box.*
It's pretty widely used for things like splash potions and mob spawners. Also pressure plates, if I recall correctly.
*You can get one by calling AxisAlignedBoundingBox.getAABBFromPool(xmin, ymin, zmin, xmax, ymax, zmax) if I am recalling the class and method names correctly.
Right okay I tried this code out: https://gist.github.com/robertcarr22/21f97f33584c3e0b8468
and it works well in the south east direction but doesn't work at all in any other direction.
This is probably because I've don't the maths for the bounding box wrong but Im not entirely sure..
EDIT: Seems to be with the calculation of where the player is looking not the bounding box
Okay it actually seems to be something wrong with detecting entities in the box. It detects entities in the bounding box when facing south east but not any other direction. I can't figure out what is going wrong
-
Use:
Side side = FMLCommonHandler.instance().getEffectiveSide(); if (side == Side.CLIENT) { if(tickCooldown<=0){ ClientSideStuff tickCooldown = 2; } }else{ ServerStuff }
the tick cooldown should be --'d every client side tick also.
Thanks for this but i don't need to separate the client and server anymore I'm having a different problem
-
The two params are:
1) The entity class you are interested in.
2) An axis aligned bounding box.*
It's pretty widely used for things like splash potions and mob spawners. Also pressure plates, if I recall correctly.
*You can get one by calling AxisAlignedBoundingBox.getAABBFromPool(xmin, ymin, zmin, xmax, ymax, zmax) if I am recalling the class and method names correctly.
Right okay I tried this code out: https://gist.github.com/robertcarr22/21f97f33584c3e0b8468
and it works well in the south east direction but doesn't work at all in any other direction.
This is probably because I've don't the maths for the bounding box wrong but Im not entirely sure..
EDIT: Seems to be with the calculation of where the player is looking not the bounding box
-
I did it with worldObj#getEntitiesWithinAABB and scan for every entity in the list(Maybe there is a better way, tell me if you have one afterwards).
and this is partly(or all? I cant remember) copy from code of enderman to know if the obj is looking at by the player.
--snip--
never heard of that method… what are the 2 params you put in the getEntitiesWithinAABB method? and where does that code get used?
-
Minecraft is a client side only class.
You should try to get the entity the player is pointing at in the server side without Minecraft#objectMouseOver.
As it's client only, when the target is not null, it would be always client side.
Ahhhh i see! Is there anyway to find the entity a player is looking at that will work on server side?
-
Previous issue solved.
Scroll down for current issue
Circle of particles in direction of player
in Modder Support
Posted
I am trying out a few things and have code that when you right click with a wand item it knocks back the entity your pointing at. I now want a circle of particles to appear as if its a spell hit.
here is the code i have for spawning the particles:
http://gist.github.com/robertcarr22/52acc1d813e1fe68b910
All the spawning of the particles work its just making them move out circularly