{"action":"closed","number":3356,"pull_request":{"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356","id":92349094,"html_url":"https://github.com/MinecraftForge/MinecraftForge/pull/3356","diff_url":"https://github.com/MinecraftForge/MinecraftForge/pull/3356.diff","patch_url":"https://github.com/MinecraftForge/MinecraftForge/pull/3356.patch","issue_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3356","number":3356,"state":"closed","locked":false,"title":"Add support for custom entity selectors in commands","user":{"login":"maxanier","id":3747729,"avatar_url":"https://avatars.githubusercontent.com/u/3747729?v=3","gravatar_id":"","url":"https://api.github.com/users/maxanier","html_url":"https://github.com/maxanier","followers_url":"https://api.github.com/users/maxanier/followers","following_url":"https://api.github.com/users/maxanier/following{/other_user}","gists_url":"https://api.github.com/users/maxanier/gists{/gist_id}","starred_url":"https://api.github.com/users/maxanier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxanier/subscriptions","organizations_url":"https://api.github.com/users/maxanier/orgs","repos_url":"https://api.github.com/users/maxanier/repos","events_url":"https://api.github.com/users/maxanier/events{/privacy}","received_events_url":"https://api.github.com/users/maxanier/received_events","type":"User","site_admin":false},"body":"Implementation of #3345\r\nAdded event for collecting entity selectors in commands.\r\n\r\n- Whenever a selector is used in a command (e.g. \"/kill @a[m=2]\"), an EntitySelectorEvent is thrown.\r\n  Custom selectors/predicates can be added to that event.\r\n- Also allows ':' in arguments so mods can check for e.g. \"vampirism:faction=vampire\" to avoid mod conflicts. (Is not checked, so only optional)\r\n\r\nI was not sure about the appropriate package and naming, if you do not like it, I will change it.\r\n\r\nExample usage:\r\n```java\r\n    \r\n    @SubscribeEvent\r\n    public void onEntitySelector(EntitySelectorEvent event){\r\n        Map<String, String> arguments = event.getMap();\r\n        String argument = arguments.get(\"vampirism:livetime\");\r\n        if(argument!=null){\r\n            final int value=Integer.parseInt(argument);\r\n            event.addPredicate(new Predicate<Entity>() {\r\n                @Override\r\n                public boolean apply(@Nullable Entity input) {\r\n                    if(input!=null){\r\n                        return input.ticksExisted==value;\r\n                    }\r\n                    return false;\r\n                }\r\n            });\r\n        }\r\n    }\r\n```\r\n\r\nA more \"useful\" example, which I already tested, can be found [here](https://github.com/TeamLapen/Vampirism/blob/2f9b592ffd1e47751d350b60e38551410a0c37b6/src/main/java/de/teamlapen/vampirism/core/ModEventHandler.java#L55-L99)","created_at":"2016-11-04T14:25:40Z","updated_at":"2016-11-05T20:12:05Z","closed_at":"2016-11-05T20:12:05Z","merged_at":"2016-11-05T20:12:05Z","merge_commit_sha":"42e0fbbb0278e904c36c17e522704aefd148ad8b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356/commits","review_comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356/comments","review_comment_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3356/comments","statuses_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/statuses/fa52d8dada3ea9f735a43b783817a2a269f2f08f","head":{"label":"maxanier:custom_entity_selectors","ref":"custom_entity_selectors","sha":"fa52d8dada3ea9f735a43b783817a2a269f2f08f","user":{"login":"maxanier","id":3747729,"avatar_url":"https://avatars.githubusercontent.com/u/3747729?v=3","gravatar_id":"","url":"https://api.github.com/users/maxanier","html_url":"https://github.com/maxanier","followers_url":"https://api.github.com/users/maxanier/followers","following_url":"https://api.github.com/users/maxanier/following{/other_user}","gists_url":"https://api.github.com/users/maxanier/gists{/gist_id}","starred_url":"https://api.github.com/users/maxanier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxanier/subscriptions","organizations_url":"https://api.github.com/users/maxanier/orgs","repos_url":"https://api.github.com/users/maxanier/repos","events_url":"https://api.github.com/users/maxanier/events{/privacy}","received_events_url":"https://api.github.com/users/maxanier/received_events","type":"User","site_admin":false},"repo":{"id":72659151,"name":"MinecraftForge","full_name":"maxanier/MinecraftForge","owner":{"login":"maxanier","id":3747729,"avatar_url":"https://avatars.githubusercontent.com/u/3747729?v=3","gravatar_id":"","url":"https://api.github.com/users/maxanier","html_url":"https://github.com/maxanier","followers_url":"https://api.github.com/users/maxanier/followers","following_url":"https://api.github.com/users/maxanier/following{/other_user}","gists_url":"https://api.github.com/users/maxanier/gists{/gist_id}","starred_url":"https://api.github.com/users/maxanier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxanier/subscriptions","organizations_url":"https://api.github.com/users/maxanier/orgs","repos_url":"https://api.github.com/users/maxanier/repos","events_url":"https://api.github.com/users/maxanier/events{/privacy}","received_events_url":"https://api.github.com/users/maxanier/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxanier/MinecraftForge","description":"Modifications to the Minecraft base files to assist in compatibility between mods.","fork":true,"url":"https://api.github.com/repos/maxanier/MinecraftForge","forks_url":"https://api.github.com/repos/maxanier/MinecraftForge/forks","keys_url":"https://api.github.com/repos/maxanier/MinecraftForge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxanier/MinecraftForge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxanier/MinecraftForge/teams","hooks_url":"https://api.github.com/repos/maxanier/MinecraftForge/hooks","issue_events_url":"https://api.github.com/repos/maxanier/MinecraftForge/issues/events{/number}","events_url":"https://api.github.com/repos/maxanier/MinecraftForge/events","assignees_url":"https://api.github.com/repos/maxanier/MinecraftForge/assignees{/user}","branches_url":"https://api.github.com/repos/maxanier/MinecraftForge/branches{/branch}","tags_url":"https://api.github.com/repos/maxanier/MinecraftForge/tags","blobs_url":"https://api.github.com/repos/maxanier/MinecraftForge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxanier/MinecraftForge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxanier/MinecraftForge/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxanier/MinecraftForge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxanier/MinecraftForge/statuses/{sha}","languages_url":"https://api.github.com/repos/maxanier/MinecraftForge/languages","stargazers_url":"https://api.github.com/repos/maxanier/MinecraftForge/stargazers","contributors_url":"https://api.github.com/repos/maxanier/MinecraftForge/contributors","subscribers_url":"https://api.github.com/repos/maxanier/MinecraftForge/subscribers","subscription_url":"https://api.github.com/repos/maxanier/MinecraftForge/subscription","commits_url":"https://api.github.com/repos/maxanier/MinecraftForge/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxanier/MinecraftForge/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxanier/MinecraftForge/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxanier/MinecraftForge/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxanier/MinecraftForge/contents/{+path}","compare_url":"https://api.github.com/repos/maxanier/MinecraftForge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxanier/MinecraftForge/merges","archive_url":"https://api.github.com/repos/maxanier/MinecraftForge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxanier/MinecraftForge/downloads","issues_url":"https://api.github.com/repos/maxanier/MinecraftForge/issues{/number}","pulls_url":"https://api.github.com/repos/maxanier/MinecraftForge/pulls{/number}","milestones_url":"https://api.github.com/repos/maxanier/MinecraftForge/milestones{/number}","notifications_url":"https://api.github.com/repos/maxanier/MinecraftForge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxanier/MinecraftForge/labels{/name}","releases_url":"https://api.github.com/repos/maxanier/MinecraftForge/releases{/id}","deployments_url":"https://api.github.com/repos/maxanier/MinecraftForge/deployments","created_at":"2016-11-02T16:26:58Z","updated_at":"2016-11-02T16:27:02Z","pushed_at":"2016-11-05T11:35:37Z","git_url":"git://github.com/maxanier/MinecraftForge.git","ssh_url":"git@github.com:maxanier/MinecraftForge.git","clone_url":"https://github.com/maxanier/MinecraftForge.git","svn_url":"https://github.com/maxanier/MinecraftForge","homepage":"","size":88464,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"1.10.x"}},"base":{"label":"MinecraftForge:1.10.x","ref":"1.10.x","sha":"9a9c02fa2598f1f025993686789c9e3bc10385db","user":{"login":"MinecraftForge","id":1390178,"avatar_url":"https://avatars.githubusercontent.com/u/1390178?v=3","gravatar_id":"","url":"https://api.github.com/users/MinecraftForge","html_url":"https://github.com/MinecraftForge","followers_url":"https://api.github.com/users/MinecraftForge/followers","following_url":"https://api.github.com/users/MinecraftForge/following{/other_user}","gists_url":"https://api.github.com/users/MinecraftForge/gists{/gist_id}","starred_url":"https://api.github.com/users/MinecraftForge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinecraftForge/subscriptions","organizations_url":"https://api.github.com/users/MinecraftForge/orgs","repos_url":"https://api.github.com/users/MinecraftForge/repos","events_url":"https://api.github.com/users/MinecraftForge/events{/privacy}","received_events_url":"https://api.github.com/users/MinecraftForge/received_events","type":"Organization","site_admin":false},"repo":{"id":3301400,"name":"MinecraftForge","full_name":"MinecraftForge/MinecraftForge","owner":{"login":"MinecraftForge","id":1390178,"avatar_url":"https://avatars.githubusercontent.com/u/1390178?v=3","gravatar_id":"","url":"https://api.github.com/users/MinecraftForge","html_url":"https://github.com/MinecraftForge","followers_url":"https://api.github.com/users/MinecraftForge/followers","following_url":"https://api.github.com/users/MinecraftForge/following{/other_user}","gists_url":"https://api.github.com/users/MinecraftForge/gists{/gist_id}","starred_url":"https://api.github.com/users/MinecraftForge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MinecraftForge/subscriptions","organizations_url":"https://api.github.com/users/MinecraftForge/orgs","repos_url":"https://api.github.com/users/MinecraftForge/repos","events_url":"https://api.github.com/users/MinecraftForge/events{/privacy}","received_events_url":"https://api.github.com/users/MinecraftForge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MinecraftForge/MinecraftForge","description":"Modifications to the Minecraft base files to assist in compatibility between mods.","fork":false,"url":"https://api.github.com/repos/MinecraftForge/MinecraftForge","forks_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/forks","keys_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/teams","hooks_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/hooks","issue_events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/events{/number}","events_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/events","assignees_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/assignees{/user}","branches_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/branches{/branch}","tags_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/tags","blobs_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/git/refs{/sha}","trees_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/statuses/{sha}","languages_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/languages","stargazers_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/stargazers","contributors_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/contributors","subscribers_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/subscribers","subscription_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/subscription","commits_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/commits{/sha}","git_commits_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/git/commits{/sha}","comments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/comments{/number}","issue_comment_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/comments{/number}","contents_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/contents/{+path}","compare_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/merges","archive_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/downloads","issues_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues{/number}","pulls_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls{/number}","milestones_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/milestones{/number}","notifications_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/labels{/name}","releases_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/releases{/id}","deployments_url":"https://api.github.com/repos/MinecraftForge/MinecraftForge/deployments","created_at":"2012-01-30T01:35:01Z","updated_at":"2016-11-05T14:46:44Z","pushed_at":"2016-11-05T20:12:05Z","git_url":"git://github.com/MinecraftForge/MinecraftForge.git","ssh_url":"git@github.com:MinecraftForge/MinecraftForge.git","clone_url":"https://github.com/MinecraftForge/MinecraftForge.git","svn_url":"https://github.com/MinecraftForge/MinecraftForge","homepage":"","size":154185,"stargazers_count":1579,"watchers_count":1579,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":839,"mirror_url":null,"open_issues_count":254,"forks":839,"open_issues":254,"watchers":1579,"default_branch":"1.10.x"}},"_links":{"self":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356"},"html":{"href":"https://github.com/MinecraftForge/MinecraftForge/pull/3356"},"issue":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3356"},"comments":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/issues/3356/comments"},"review_comments":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356/comments"},"review_comment":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/pulls/3356/commits"},"statuses":{"href":"https://api.github.com/repos/MinecraftForge/MinecraftForge/statuses/fa52d8dada3ea9f735a43b783817a2a269f2f08f"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"LexManos","id":702211,"avatar_url":"https://avatars.githubusercontent.com/u/702211?v=3","gravatar_id":"","url":"https://api.github.com/users/LexManos","html_url":"https://github.com/LexManos","followers_url":"https://api.github.com/users/LexManos/followers","following_url":"https://api.github.com/users/LexManos/following{/other_user}","gists_url":"https://api.github.com/users/LexManos/gists{/gist_id}","starred_url":"https://api.github.com/users/LexManos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LexManos/subscriptions","organizations_url":"https://api.github.com/users/LexManos/orgs","repos_url":"https://api.github.com/users/LexManos/repos","events_url":"https://api.github.com/users/LexManos/events{/privacy}","received_events_url":"https://api.github.com/users/LexManos/received_events","type":"User","site_admin":false},"comments":4,"review_comments":1,"commits":3,"additions":141,"deletions":2,"changed_files":3}}
{"actor":{"display_login":"LexManos"}}