VikeStep
Members-
Posts
10 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
VikeStep's Achievements
Tree Puncher (2/8)
0
Reputation
-
[1.7.10] PlayerSleepInBedEvent behaving differently on a server
VikeStep replied to VikeStep's topic in Modder Support
I haven't actually had experience with sending packets to a client. I'll have a look. But yeah I definitely could do it on the server and send a packet to the client. Reason I wanted it on the client is because I was hoping to make this a completely client side mod (no need for server) however I guess I will need to require it on a server -
[1.7.10] PlayerSleepInBedEvent behaving differently on a server
VikeStep replied to VikeStep's topic in Modder Support
I've been looking into it but how else could I find whether a bed has been interacted with? -
I need to detect if there are mobs nearby when a user tries to access a bed and have set up an event handler for PlayerSleepInBedEvent. On a single player world, if a player tries to sleep in a bed, the event is fired. Even if there are mobs nearby, or if it is day time etc. When connecting to a server (which has the mod) and using the client the event will only fire if they are successful in sleeping. Is this intended or a forge bug or something else? Corresponding Code: public class PlayerBedEventHandler { @SubscribeEvent public void onPlayerSleepInBedEvent (PlayerSleepInBedEvent event) { FMLLog.log(Reference.MOD_NAME, Level.INFO, "PlayerSleepInBedEvent"); List<EntityMob> list = NearbyMobHelper.findNearbyMobs(event.entityPlayer, event.x, event.y, event.z); if (Settings.enableNearbyMobCheckAtBed && !list.isEmpty() && !event.entityPlayer.worldObj.isDaytime() && !(Math.abs(event.entityPlayer.posX - (double)event.x) > 3.0D || Math.abs(event.entityPlayer.posY - (double)event.y) > 2.0D || Math.abs(event.entityPlayer.posZ - (double)event.z) > 3.0D)) { TickHandler.playerRequesting = event.entityPlayer; TickHandler.nearbyMobList = list; } } } The FMLLog is how I am detecting if it works and it does not log anything when trying to access a bed if there are monsters nearby. However it will fire when successfully sleeping in a bed. The FMLLog works in all cases in single player. NOTE: This may be an actual forge bug so if it is, a moderator or likewise can move it to bug reports. However, I am not sure if it's a bug so here it remains. EDIT: Using Forge 10.13.2.1230
-
[Unresolved]Adding Item to Inventory after eating Chicken
VikeStep replied to VikeStep's topic in Modder Support
Its still a risk I'm not willing to take, because in the event that there is a mod that does that, then I will have to remake the whole thing or just let it stay incompatible. EDIT: Found One http://www.minecraftforum.net/topic/1813158-152-iguanamans-hunger-overhaul/ -
[Unresolved]Adding Item to Inventory after eating Chicken
VikeStep replied to VikeStep's topic in Modder Support
ok then, I new what Pull requests were, but I was just not sure I'd be asking for the right hook or something like that, I will probably use this if I can't get method 2 to work I had heard of reflections before (as i said, I have been doing programming for quite a while), but I was unsure how to implement it in Minecraft Modding This may be do-able, I will do some research to see what I need to do this. I remember from installing mods in MultiMC that there was a coremods folder, are you saying that I need to make a second mod to go in coremods and also have my main mod in mods or is this coremods you are speaking of something completely different That reason is enough to convince me not to use this method. I would like my mod to be compatible with as many as possible. -
[Unresolved]Adding Item to Inventory after eating Chicken
VikeStep replied to VikeStep's topic in Modder Support
1) i dont know how to use GitHub, but if it comes down to it I may do that 2) I have no clue what that means, could you please elaborate 3) wouldn't this be a base edit? or are you saying to create a whole new class that overrides the vanilla cooked chicken and also would this mean that this mod would be less compatible with other mods that use cooked Chicken EDIT: I wont be back for another 8-10 hours to respond to this -
So firstly let me say that I am quite new to modding minecraft but know quite a bit about programming so should be able to grasp most solutions provided basically, I want to make it so that when you eat Cooked Chicken, you get a bone in your inventory, similar to how eating a bowl of soup will leave you with a bowl in your inventory. When inspecting the soup code, I found that it has its own class and that it uses onEaten() to determine when it is being eaten and then gives the item to the player However I am not sure how to add this trait to cooked chicken without using base edits. I was told on the forge IRC to add a hook to onItemUse() but am unsure how to implement that. any help is greatly appreciated. I also have searched for an event but I can't find any events that occur when an item is used or a food is eaten.
-
Can't speak in #minecraftforge on esper.net
VikeStep replied to VikeStep's topic in General Discussion
oh, I was using a Web Client, I will download it thanks -
I'm posting this problem here since its not a bug/support problem with Forge but it's a problem I have only been having on Forge's esper.net channel Whenever I try to say something in their it says: Cannot send to channel: #minecraftforge I would send a bug report to esper.net but there may be something yous can help with since this is only happening with this channel and if you are wondering I am registered and logged in with the nickname VikeStep if you recommend then I will ask esper.net for help