{"action":"created","issue":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2340","labels_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2340/labels{/name}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2340/comments","events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2340/events","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2340","id":125293059,"number":2340,"title":"Event for when EntityThrowables impact","user":{"login":"williewillus","id":2015032,"avatar_url":"https://avatars.githubusercontent.com/u/2015032?v=3","gravatar_id":"","url":"https://api.github.com/users/williewillus","html_url":"https://github.com/williewillus","followers_url":"https://api.github.com/users/williewillus/followers","following_url":"https://api.github.com/users/williewillus/following{/other_user}","gists_url":"https://api.github.com/users/williewillus/gists{/gist_id}","starred_url":"https://api.github.com/users/williewillus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williewillus/subscriptions","organizations_url":"https://api.github.com/users/williewillus/orgs","repos_url":"https://api.github.com/users/williewillus/repos","events_url":"https://api.github.com/users/williewillus/events{/privacy}","received_events_url":"https://api.github.com/users/williewillus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-07T00:09:39Z","updated_at":"2016-01-24T22:27:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/2340","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2340","diff_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2340.diff","patch_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2340.patch"},"body":"Updated version of #2020. Blurb below:\r\n\r\n\r\nThis pull adds an event that is fired immediately before EntityThrowables (Eggs, Enderpearls, Snowballs, Splash Potions, and Bottles of Enchanting in vanilla) call their onImpact() method. This allows for modders to not only add logic to vanilla throwables but also to those of other mods.\r\n\r\nMy main purpose for proposing this was to reimplement the \"snowballs knockback players in MP\" vanilla feature that was removed quite a while ago, and there didn't seem to be any clean solution, other than tracking every snowball in a tickhandler to see if it's touching a player (ew), or coremodding (ewww).\r\n\r\nUsing this event, I could simply subscribe to a ThrowableImpactEvent, check if it was a snowball, check that the MovingObjectPosition was targeting a player, then knock back said player.\r\n\r\nCanceling the event simply skips the call to onImpact. It is up to the modder to handle killing or otherwise resetting the entity.\r\n"},"comment":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/comments/174347259","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2340#issuecomment-174347259","issue_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2340","id":174347259,"user":{"login":"williewillus","id":2015032,"avatar_url":"https://avatars.githubusercontent.com/u/2015032?v=3","gravatar_id":"","url":"https://api.github.com/users/williewillus","html_url":"https://github.com/williewillus","followers_url":"https://api.github.com/users/williewillus/followers","following_url":"https://api.github.com/users/williewillus/following{/other_user}","gists_url":"https://api.github.com/users/williewillus/gists{/gist_id}","starred_url":"https://api.github.com/users/williewillus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/williewillus/subscriptions","organizations_url":"https://api.github.com/users/williewillus/orgs","repos_url":"https://api.github.com/users/williewillus/repos","events_url":"https://api.github.com/users/williewillus/events{/privacy}","received_events_url":"https://api.github.com/users/williewillus/received_events","type":"User","site_admin":false},"created_at":"2016-01-24T22:27:36Z","updated_at":"2016-01-24T22:27:36Z","body":"Updated to use ForgeHooks"}}