Jump to content

yetanothermodder

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by yetanothermodder

  1. ty.. Sounds boring but ok..
  2. Hey guys, so I get my mod workin as expected and i'm glad ^^ I use gradle to build it and it works great though somethin 's botherin me : I built it for 1.8.9 and 1.7.10; but now I see some cool mods aren't available for 1.8.9 but only for 1.8.1... So I guess there is a way to publish a version for 1.8.x (without building for each version) currently my gradle build file contains somethin like the line below for 1.8.9 : version = "1.8.9-11.15.1.1722" can i just change that to : version = "1.8.*" ? sounds too good to be true..
  3. ty though it doesn't seem to have it in minecraft 1.7.10 think i found it named func_147104_D()
  4. Hey how do you get the current minecraft server url from the client side ? I'm codin a client side mod and i need to know the sever url when the player goes multiplayer game ty ^^
  5. Hi, So my mod which is only client side, has to react differently depending on the game type :singleplayer or multiplayer. So i'm looking for a client side event when a game is created/loaded or when a server joined, in order to set my boolean isSPGame to true or false... (I need both to reset it) ty for your tips i found it PlayerLoggedInEvent PlayerLoggedOutEvent
  6. OK ty for all that info dude It makes sense on one hand as it's not cause u get hurt that u know the dmg source (I mean IRL)... So the paradigm is logical And yes I insist ^^ as I really want my mod to be able to operate on any server I think i will just go for if u lose health your in fight when in MP mode... won't be wrong so often as u mostly get hurt when in fight (it's more rare to get hurt cause starvin, suffocatin or burnin... than cause in fight when in MP mode) might be enough occurate for my use
  7. Yes ty, that explains a lot ^^ as i wasn't even able to detect attack even from IMob when on server... So there is no simple way to know what did the dmg to my player when connected on server ? (as when it gets attacked it's only fired on server side ?)
  8. ty guys ^^ that last event is makin me struggling @SubscribeEvent public void fightin(LivingAttackEvent evt){ if (((evt.entityLiving instanceof EntityPlayer) && (evt.source.getEntity() instanceof IMob)) || ((evt.entityLiving instanceof IMob) && (evt.source.getEntity() instanceof EntityPlayer))){ system.out.println(FIGHT); } } I need to detect when the player is in fight but in multiplayer mode. So Other players would be considered as hostile living entity
  9. Ty so much !!! with TickEvent.PlayerTickEvent it works !! didn't try the livingEvent as my target is the player the Player seemed more appropriate. But how do you guess which event to use or not to use ? like how can one guesses a method named "isEating" means "isRightClicking" ^^ ?
  10. I'm not speakin of logs but of the stdout I run it in Eclipse . (And i use --username and --password args for being able to join a server (even try with my own server to be sure it wasn't some kind of protection on the server i was connectin too.. but same result)) Btw i also tried with breakpoints in debug mode and playerEvent is triggered only once in mp (right after the world loading event; then it will not be triggered anymore unlike in singleplayer where it's systematicaly triggered...) I will try with the events you suggested and let u know
  11. Ok I got my mod working in singleplayer mode as i wanted it to. I was hopin it to run the same when joinin a server as it's a client side only simple mod... ..but no ;( Sry guys if it sounds like an obvious thing i'm really new to forge ^^ here's my code Main.java (imports) @Mod(modid = Main.MODID, name = Main.MODNAME, version=Main.VERSION, clientSideOnly=true) public class Main { public static final String MODID = "mymod"; public static final String MODNAME = "MyMod"; public static final String VERSION = "1.8.9-0.1"; PlayerWatcherHandler playerHandler = new PlayerWatcherHandler(); @Instance(value = Main.MODID) public static Main instance; @EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(playerHandler); } @EventHandler public void init(FMLInitializationEvent e) { } @EventHandler public void postInit(FMLPostInitializationEvent e) { } } ////////////////////////////////////////////////////////////////////////////////////////////////// playerwatcherhandler.java (imports) public class PlayerWatcherHandler { public PlayerWatcherHandler() {} @SubscribeEvent public void speedy(PlayerEvent evt){ if (evt.entityPlayer.isSprinting()) System.out.println("Gonzales"); } } This code print out gonzales when i run in singleplayer game but doesn't in multipleplayer... Why ? how to solve that ?
  12. Ok I've just watched the region file structure and seems they got all I need.. So i will mark this as [KINDA SOLVED] Sadly checkin the last modification time won't be enough as they store both entities and blocks .. So maybe i will just consider the player is explorin when a new region file is generated (which if less occurate will also be less time consumin as i plan to check once every 20 sec or so... I don't need really precise trigger) if anyone comes out with a better solution (an event in my dreams ) i would be happy to learn it
  13. This mod operates on client side so its region folder will only contains regions HE explored. When u join a server your client doesn't download the whole world map (i'm pretty sure of that), but just the region you're in and then the next one as u enter it... So there must be an event (maybe a private or protected one) when the client needs new world data... At least I could check files as i said... Anyway, right now I'm workin on a client side single player mod. And if I want it to work on server then i might have to store data; but until then files generated by minecraft (or an appropriate event) should do the trick... I just need to know when region files are modified (and what exactly they contain (for exemple only blocks, or blocks+entity....) so i can evaluate depending on the changes volume if it's just some enderman removing a block within the region or a real world generation from the seed.)) Btw if by : you mean soft only work once installed, well it's a tautology so i agree but if you mean a mod can't produce retroactive effects; i don't. cause one can surely create a mod which will turn all your coal ore (even already generated one) into gold ore for exemple... Anyway from a server point of view you were right. U just assumed a little fast I was moddin for server side (but my bad for the lack of precision ^^)
  14. Ty dude, might be useful; though I would like to know when a player explore for the very first time an area. ie your solution won't work if one installs the mod in an already existing game; as it will detect all parts of the map u already know as new for one time... but ty for the tip. Maybe if no such event exists, i can read files within region folder to check new zone generation ? But i guess it might be complicated as if i can assume a player is exploring if a new file appears in one of this folder; i can't confirm he isn't exploring if no new file appears (as files cover big area and can be partialy explored)
  15. Hi guys, I'm new to minecraft modding and i was wondering if there is an event triggered when a player enter an area (some chunks in mc vocabulary i guess) that he never went before. I want to know when a player is exploring a new zone. Ty (btw it's for forge version 1.7.10 and 1.8.9 as my mod is currently available for these 2 versions)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.