Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [2:08:12 AM] Noppes: sure
- [2:08:24 AM] Noppes: first I have an entity you need
- [2:08:28 AM] *** Noppes sent EntityChairMount.java ***
- [2:09:09 AM] Noppes: register said entity
- [2:10:19 AM] Noppes: Next make a function in your block class like
- [2:10:20 AM] Noppes:
- public static boolean MountBlock(World world, int x, int y, int z, EntityPlayer player){
- if(world.isRemote)
- return true;
- List<Entity> list = world.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
- for(Entity entity : list){
- if(entity instanceof EntityChairMount || entity instanceof EntityCustomNpc)
- return false;
- }
- EntityChairMount mount = new EntityChairMount(world);
- mount.setPosition(x + 0.5f, y, z + 0.5);
- player.mountEntity(mount);
- world.spawnEntityInWorld(mount);
- player.mountEntity(mount);
- return true;
- }
- [2:10:45 AM] Noppes: and than simply call it from blockactivated
- [2:10:46 AM] Noppes:
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){
- return MountBlock(world, x, y, z, player);
- }
- [2:11:04 AM] Noppes: and thats it
- [8:02:47 AM] Razz: thank you Noppy
- [8:14:33 AM] Noppes: np
- [8:27:58 AM] Noppes: oh from the function you will probably want to remove the || entity instanceof EntityCustomNpc
- [8:28:15 AM] Noppes: Im preventing players from sitting on chairs npcs sit on
- [8:57:33 AM] Razz: oh?
- [8:57:38 AM] Razz: hhahahahaha cool
- [8:59:01 AM] Noppes: yupyup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement