本文整理了Java中org.bukkit.Bukkit.getEntity()
方法的一些代码示例,展示了Bukkit.getEntity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bukkit.getEntity()
方法的具体详情如下:
包路径:org.bukkit.Bukkit
类名称:Bukkit
方法名:getEntity
暂无
代码示例来源:origin: GlowstoneMC/Glowstone
@Override
public void handle(GlowSession session, SpectateMessage message) {
GlowPlayer player = session.getPlayer();
if (player.getGameMode() == GameMode.SPECTATOR && !Objects
.equals(player.getProfile().getId(), message.getTarget())) {
Entity entity = Bukkit.getEntity(message.getTarget());
if (entity != null) {
player.setSpectatorTarget(entity);
}
}
}
}
代码示例来源:origin: xXKeyleXx/MyPet
public Entity getEntityByUUID(UUID uuid) {
return Bukkit.getEntity(uuid);
}
}
代码示例来源:origin: lucko/helper
@Nonnull
@Override
public <K> Map<Entity, K> getAllWithKey(@Nonnull MetadataKey<K> key) {
Objects.requireNonNull(key, "key");
ImmutableMap.Builder<Entity, K> ret = ImmutableMap.builder();
this.cache.asMap().forEach((uuid, map) -> map.get(key).ifPresent(t -> {
Entity entity = Bukkit.getEntity(uuid);
if (entity != null) {
ret.put(entity, t);
}
}));
return ret.build();
}
}
代码示例来源:origin: me.lucko/helper
@Nonnull
@Override
public <K> Map<Entity, K> getAllWithKey(@Nonnull MetadataKey<K> key) {
Objects.requireNonNull(key, "key");
ImmutableMap.Builder<Entity, K> ret = ImmutableMap.builder();
this.cache.asMap().forEach((uuid, map) -> map.get(key).ifPresent(t -> {
Entity entity = Bukkit.getEntity(uuid);
if (entity != null) {
ret.put(entity, t);
}
}));
return ret.build();
}
}
代码示例来源:origin: NyaaCat/RPGItems-reloaded
setPositionRotation.invoke(entity, loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch());
UUID uuid = (UUID) getUUID.invoke(entity);
Entity e = Bukkit.getEntity(uuid);
if (e != null) {
if (e instanceof Projectile) {
代码示例来源:origin: libraryaddict/LibsDisguises
if (args[0].contains("-")) {
try {
p = Bukkit.getEntity(UUID.fromString(args[0]));
代码示例来源:origin: libraryaddict/LibsDisguises
if (args[0].contains("-")) {
try {
entity = Bukkit.getEntity(UUID.fromString(args[0]));
内容来源于网络,如有侵权,请联系作者删除!