{"action":"created","issue":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2020","labels_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2020/labels{/name}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2020/comments","events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2020/events","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2020","id":95262605,"number":2020,"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":"2015-07-15T18:41:00Z","updated_at":"2015-12-01T14:25:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/2020","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2020","diff_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2020.diff","patch_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2020.patch"},"body":"This 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.\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\nI didn't make the event cancelable because if done so, the entity would simply keep its current trajectory into whatever block or entity it hit, and, more likely than not, just fire the same event again in subsequent ticks. Perhaps the entity could be killed after the event is canceled, but that is up for debate."},"comment":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/comments/160982947","html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/2020#issuecomment-160982947","issue_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/2020","id":160982947,"user":{"login":"asiekierka","id":113514,"avatar_url":"https://avatars.githubusercontent.com/u/113514?v=3","gravatar_id":"","url":"https://api.github.com/users/asiekierka","html_url":"https://github.com/asiekierka","followers_url":"https://api.github.com/users/asiekierka/followers","following_url":"https://api.github.com/users/asiekierka/following{/other_user}","gists_url":"https://api.github.com/users/asiekierka/gists{/gist_id}","starred_url":"https://api.github.com/users/asiekierka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asiekierka/subscriptions","organizations_url":"https://api.github.com/users/asiekierka/orgs","repos_url":"https://api.github.com/users/asiekierka/repos","events_url":"https://api.github.com/users/asiekierka/events{/privacy}","received_events_url":"https://api.github.com/users/asiekierka/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T14:25:37Z","updated_at":"2015-12-01T14:25:37Z","body":"Would be nice indeed, though I wonder if overriding the snowball entity isn't a (hacky) alternative..."}}