Jump to content

OCDiary

Members
  • Posts

    12
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

OCDiary's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey Guys and Girls, I have made a new discord server for us devs to use. I know there are some servers out there already, however, they seem to be a little bit more specific on who can join. I wanted to make something that newbies and veterans alike could use. I have several channels all with different agendas. But I thought it could be a cool place for people to showcase some of their work/ideas, meet some like minded people, and maybe collaborate on some stuff? So if you would be interested in joining head on over by clicking here or the 'Discord' below OC Discord P.S. I will be in need of some moderators and admins if the discord starts to grow. But I would appreciate not being inundated with message asking. So just be helpful and chatty and let it happen naturally
  2. Hey Diesieben07, I had a funny feeling you would say that, I just didnt want to have to setup a redirect uri and everything. Shame it was so simple but now seems a lot more of a pain to do just a simple online check. Thanks again OC
  3. Ahh ok thank you, I will give this a go and come back if I fail lol! Thanks so much for the help OC
  4. Quite right, I want them to spawn at the point where the Item hits, on top of said block. So when you toss the item the mob spawns where it lands. At the moment they spawn behind the player. Sorry should have been more specific Thanks OC
  5. Hi, I am currently working on a new idea for a mod, but have gotten a little stumped. I want it to be that when an item is dropped (by a player or machine, such as a dropper) the item would despawn and a mob would spawn in its place. I know this should be simple but I am completely stumped. I have been trying to accomplish this with a ItemTossEvent, which is semi-successful. @SubscribeEvent public void ironNuggetDrop(ItemTossEvent e){ World world = e.getEntity().world; Item item = e.getEntityItem().getEntityItem().getItem(); BlockPos pos = e.getEntityItem().getPosition(); if(!world.isRemote){ if(item == Items.APPLE){ spawnSkelly(world, pos); e.getEntityItem().isDead = true; } }else{ e.getPlayer().sendMessage(new TextComponentString("it works, you dropped it")); } } private void spawnSkelly(World worldIn, BlockPos pos){ EntitySkeleton skelly = new EntitySkeleton (worldIn); skelly.setPosition(pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5); worldIn.spawnEntity(skelly); } There is a couple of issues however: 1) The item immediately despawns, so you do not even see it. Which I want it to be there for like a second if possible. 2) It does not work with droppers and such. 3) The mobs are spawning in random orientation instead of where the item lands, which is what I wanted. So I went into another option which is to create a custom EntityThrowable. This kind of works, except I could not get a custom particle to work so it still shows nothing and a mob just spawns. And it also does not work with droppers. Any help would be greatly appreciated Thanks OC
  6. Hi LexManos, Sorry its take some time been mental busy. I want to have the mod check if a channel is live and if so will perform said action in game. Thank you diesieben07 I had looked at that previously, but couldnt work out how to just simply check if the site was live without a clientID. What I want is something like this: public static boolean checkIfOnline(String channel){ String channerUrl = "https://api.twitch.tv/kraken/streams/" + channel; String jsonText = readFromUrl(channerUrl);// reads text from URL JsonParser parser = new JsonParser(); JsonObject json = parser.parse(jsonText).getAsJsonObject(); return !json.get("stream").isJsonNull(); } private static String readFromUrl(String url) throws IOException { URL page = new URL(url); StringBuilder sb = new StringBuilder(); Scanner scanner = null; try{ scanner = new Scanner(page.openStream(), StandardCharsets.UTF_8.name()); while (scanner.hasNextLine()){ sb.append(scanner.nextLine()); } }finally{ if (scanner!=null) scanner.close(); } return sb.toString(); } Except that method no longer works. I would ideally just have a boolean that is true when the channel is live that I can then use elsewhere in the mod. Thanks so much for your help OC
  7. Hi, I want to perform a simple check on a twitch channel within my mod, all it needs to do is check if a twitch channel is online. I have tried some things I can think of but none even remotely worked and now I am completely stumped and dont know where to start. Any help would be greatly appreciated Thanks OC
  8. Do you have optifine or something similar installed? That sometimes happens to me too, but I worked out it was optifine doing it.
  9. Thanks so much that worked! Wow such a simple fix but I just could not get my head round it! Thanks again OC
  10. Hey guys/girls, I was wondering how you got the method to fire for just one hand. Im having the same issue (but being new to forge) and struggling to find a solution and drop the item just once. Thanks in advance OC
  11. Did you work out how to fire the method for one hand? Im stuck on the same issue and am ripping my hair out lol Thanks
×
×
  • Create New...

Important Information

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