Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About PlayPrey

  • Rank
    Tree Puncher


  • Gender
  • Location
  • Personal Text
    Achievement enthusiast.

Recent Profile Visitors

978 profile views
  1. Hey, guess what? Got it working- it was surprisingly simple. I saw in the PlayerPredicate class how one finds an advancement via a ResourceLocation and I stole the grant advancement code from AdvancementCommand- and it worked just fine. Advancements get granted via code as well now. Thank you. However, before I dig myself a hole that I can't get out of, I don't think so, currently this is my code. It isn't clean yet but thats OK for now. @SubscribeEvent public void onDeath(LivingDeathEvent event) { ResourceLocation rl = new ResourceLocation("advancemen
  2. OK, so what I might be realizing here, is that instead of keeping track of myself,- it should keep track of every player. (I feel like this means the host must have the mod installed and the mod won't work on servers, like the old achievement system did- but that's fine for now.) So.. What I have learned, is that my thought process was wrong. Advancements are server-side and shouldn't be messed with client-side. I have currently successfully retrieved the ServerPlayerEntity of who's killing by simply using ServerPlayerEntity spe = (ServerPlayerEntity)event.getSour
  3. I am aware of this, but I still want a way to find _me_ out of these players. I remember you or someone else mentioning finding players using Uuid,- can I somehow get my own Uuid- then check that upon the list of players to find me?
  4. By current I simply mean yourself. In the same way as "Minecraft.player" returns yourself, but I want to get the ServerPlayerEntity version. If I am playing on a server with 100 players, I still only want myself to be affected. I hope that made it more clear? The reason I need the server version of myself is because Advancements seems to be completely server-side driven.
  5. I'd like to point out, it's purely for testing purposes but I am running the code on every EntityDeath from a; @SubscribeEvent public void onDeath(LivingDeathEvent event) { if(sp == null) sp = mc.player; mp = sp.getServer().getPlayerList().getPlayerByUsername("Dev"); } This has no intention of staying in a final product. The mc variable gets assigned to from the mods initializer as mc = Minecraft.getInstance(); The variables are stored in the class itself.
  6. It certainly does, however I am missing out on something simple again. The AdvancementCommand way requires the ServerPlayerEntity,- and I have to admit I struggle getting the current player as an ServerPlayerEntity. Just to test I did something like sp = mc.player; ServerPlayerEntity mp = sp.getServer().getPlayerList().getPlayerByUsername("Dev"); Considering the debug player name is Dev I thought it might work. I know one shouldn't do getPlayerByUsername but end goal here was just to see a working result, before optimizing it. However this code just returns null +
  7. So good news, the events always worked- it's just the logging part that didn't. Tested with something else, like teleporting/hurting/etc the player and it all triggered fine. Now, I do wish there was a simple way of granting an advancement from a string value (as ID). For example: player.getAdvancement("mod:folder/jsonfile") but sadly that method doesn't exist. Does anyone know of a way like that? Or is the best way to actually create a new Criterion and reference to that from the json files? I looked into the built in triggers in the game and
  8. For some reason it doesn't work with or without the @SubscribeEvent Also, I apologize- I don't know why I felt the need to assure people "knew" about my past "experience". I guess I thought it would help people when they knew more about who they were dealing with.
  9. So I added the loop, and it still didn't show up at all in the log. This is odd, the example mod did come with logging in the other methods (which I removed) and they worked fine. @SubscribeEvent public void setup(final FMLCommonSetupEvent event) { for(int i = 0; i < 1000; i++) { LOGGER.info("Common SETUP"); } }
  10. This is not going to be pretty, brace yourself. I saw that I am adding the listener (From the forge example), but that didn't work- so I tried adding subscribe event,- which didn't work because it was a private method. This is the latest attempt at a... log message.... package no.pcservicetbg.advancementextreme; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api
  11. Did you attempt to restart Intellij just to check if it worked or not? Mine had about the same log as yours and did add the required configurations to IntelliJ to test the mod.
  12. Thank you, what you're saying does make sense- however it's been 5 years since I worked with stat tracking and things have changed. In addition to that it's been a while since I worked with Java + Forge ( I normally code C# applications ). You don't have to of course, but would you be willing to aid me with some slight tea-spoon styled assistance? Just to test I added LOGGER.info("Common setup"); into the private void setup(final FMLCommonSetupEvent event) In my head this would trigger after the mod has loaded, or during? However it never
  13. Greetings, I am attempting to update an old mod of mine, which added a lot of achievements. I thought I would start with the simple stuff, namely adding the milestone styled advancements first. However it turns out triggering an advancement after for example killing 5 zombies is more difficult than expected. It appears easy if all the entities for the advancement are different, but I tried the option that obviously wouldn't work- adding 5x of the zombie kill trigger criterion. As expected the advancement is still triggered after killing just one.
  14. Well I had forgotten to enable ticking on the block... Now to figure out the following error:
  15. Greetings,- I am trying to have my block "emulate" being so hot it sets nearby wooden structure on fire. I have looked trough BlockFire and BlockLiquid in attempt to figure out how it's done, but to no success. Am I looking in the right classes even?
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.