Set frame by plugin
#1
I can not understand in any way as to set a frame on (X, Y, Z)
Please help meBlush
Reply
Thanks given by:
#2
Any ideas?
Reply
Thanks given by:
#3
I don't think there's an API for that yet. Sorry.
Reply
Thanks given by:
#4
I believe there is: http://mc-server.xoft.cz/LuaAPI/cItemFrame.html

Or at least if that's the frame that you mean.

World:ForEachEntityInBox(cBoundingBox(X, X, Y, Y, Z, Z),
 function(a_Entity
  if (not a_Entity:IsItemFrame()) then
   return false
  end
  tolua.cast(a_Entity, "cItemFrame"):SetItem(MycItem)
 end
)
Reply
Thanks given by:
#5
Oh, right, the server keeps surprising me, we're better than I expect Smile
Reply
Thanks given by:
#6
Thank you. I'll try it.
Reply
Thanks given by:
#7
(01-18-2016, 06:30 PM)NiLSPACE Wrote: I believe there is: http://mc-server.xoft.cz/LuaAPI/cItemFrame.html

Or at least if that's the frame that you mean.

World:ForEachEntityInBox(cBoundingBox(X, X, Y, Y, Z, Z),
 function(a_Entity
  if (not a_Entity:IsItemFrame()) then
   return false
  end
  tolua.cast(a_Entity, "cItemFrame"):SetItem(MycItem)
 end
)

Thank you. But, I want to install a lot of frames on the wall. Not items into frames.
Reply
Thanks given by:
#8
Oh, I'm afraid we don't have an API to create those. It should be fairly easy to do. Just put this in a cWorld method. Something like this:
Uint32 cWorld:SpawnPainting(double a_PosX, double a_PosY, double a_PosZ, eBlockFace a_BlockFace, AString a_PaintingName)
{
	cPainting * Painting = new cPainting(a_PaintingName, a_BlockFace, a_PosX, a_PosY, a_PosZ);
	Painting->Initialize(*this);
	return Painting->GetUniqueID();
}
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)