Skip to content

Commit

Permalink
replace reflection by simple use of getId method.
Browse files Browse the repository at this point in the history
update Readme to add info about all entities availables.
  • Loading branch information
Jonathan Bavay committed Dec 21, 2022
1 parent ae50692 commit 79d77cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,5 @@ And last but not least you can get the list of recorded zone /mobcount list

In addition you have also a zone definition by having a Kelp in your principal hand and right click two block at the two coordinates.

Implemented types

COW
CHICKEN
SHEEP
PIG
RABBIT
GOAT
Implemented types: any entity by using the entity_id (e.g: cow, creeper, cat, zombie_pigman,...)
Tips: Typing an entity that does not exist will not filtering on type and will return the full count of living entity in the zone.
2 changes: 1 addition & 1 deletion src/main/java/net/mobcount/MobCountService.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static int mobCount(PlayerEntity player, BlockPos blockPos, BlockPos bloc
EntityType eType = null;
try
{
eType = (EntityType)EntityType.class.getField(s).get(null);
eType = EntityType.get(s.toLowerCase()).get();
}
catch(Exception e)
{}
Expand Down

0 comments on commit 79d77cb

Please sign in to comment.