Where player is an existing logged in player, and overrides is a function that returns the overrides of methods for a given method name. Local function fake_player(player, overrides) There is a workaround to access the luaentity and call the callbacks instead of the actions themselves with a table emulating a player as mentioned in the comments - it would still be preferable to use the system logic directly though.Creating a non-player entity would be acceptable if it could have an inventory Entity inventory #6081, but ideally I would be able to override all the methods of a custom registered entity to have it simulate a player comprehensively.The existing API methods could be changed to accept tables as well as userdata objects.At a minimum, the programmer should be able to set: the position, the look dir, the wield item, and the inventory. The method should return a userdata object which identifies as a player. SolutionsĪn API method should be added so that programmers can create a fake player, with the ability to override the player's methods if required. ![]() It should be possible to accomplish this in minetest too. This kind of fake-player is required for automating tasks such as sheering sheep, which can be accomplished automatically in. ![]() For the most part, this player can be faked with a table providing all the functions required, however some callbacks - such as the right_click action on entities require a userdata object and will throw an error if one is not provided. Most (if not all) interaction callbacks require a player to be passed who is performing the interaction, referred to as the clicker, placer, digger etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |