#help-development
1 messages · Page 1645 of 1
Yea i hadnt read this part
is arraylist a child of list?
it's a subclass, yes
ok
ArrayList extends AbstractList which implements List
i cee
you know how methods have parameters?
uh oh, parent say go bed
ye
well, the value of a parameter isn't decided by the method
it's designed by who uses the method
a type parameter is just like that, except with the type of a variable
so like with String s, someone decides the value of s, but with T thisHasAGenericType, someone decides what T is
Ok that makes sense
and with type parameters, you can also say
MyThing<T extends OtherThing>
which means T's superclass has to be OtherThing
so, MyThing<OtherOtherThing> requires that OtherOtherThing extends OtherThing
i got go
shouldn't be learning generics/wildcards type parameters before knowing covariant inheritance
What the hell is covariant inheritance?
So strange math stuffs
if S is a subtype of T, then the array S[] is a subtype of the array T[]. In words
That is more understandable (though wrong in Java space to be exact) - actually - no, it does apply
yep, it is commonly used in overridden return types
can I ask if there are any ways for plugins to query permissions of a player as if querying for configuration section
You mean iterating over a players permissions?
yes. for example, if a player has a permission of example.<number> where number is any arbitrary number, I want to know what it is
Hm. You can get the permission as raw String. Im not sure if there is any other way than manual iteration and parsing in O(n)
by that you mean iterating through all permissions that player has?
how send plugin message without any players online
You cant
ok thanks!
Spigot does not send any Plugin Message without players online
You cant send a plugin message without an online user,
is there a work around
not using messaging system
but like something else
i REALLY need to be able to do it
could u send me a method that'd work with that i have no idea how to do sockets and stuff
or walk me through it
so i learn
Sockets dangerous if you dont know what you are doing.
how
Everyone can just connect to them and send data to them
bro
idk if im gonna fuck it up
can someone walk me through how to make it
specifically for plugin messaging
thats a full tutorial on sockets in java
does it tell you how to use it for plugin messaging?
i highly doubt it
idk what im doing
You can NOT use plugin messaging
that is a Mojang feature
whta
Sockets are a huge topic. You cant just walk someone through that.
I would really recommend you just to use some REST library and communicate over that.
Is it for a public plugin or a private server?
private server
private plugin for public server
then the plugin isn't private... (Ignore me)
Then you should consider redis for cross-server communication like game queues and stuff like that
A while a go i used jedis but now im really stoked on redisson. Both have good documentations.
how does redis work
You can think of redis as a simple key-value map in memory. Its not started from any of your applications and completely environment agnostic.
This means you can save data in there and access it from multiple applications.
This also includes messaging between all connected applications.
redis can do much more than that but the key feature is: In memory key-value database
how do i use it
Redisson has a nice feature called Topics. You can just subscribe and publish to it and all participants can react to the topic in an event-based fashion.
jitpack?
Nope. Maven central. Its a big framework used by companies like Netflix, Amazon etc
The documentation is a bit much and written in enterprise style which can be quite complicated.
do u know how
Sure
public void sendPluginMessage(String channel, String subChannel, int data, UUID uuid) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF(subChannel);
out.writeUTF(uuid.toString());
out.writeInt(data);
getServer().sendPluginMessage(this, channel, out.toByteArray());
}
that method
with redis stuff
Im just thinking about how i can tell you that this is not something you just swap out.
To be honest im thinking about the struggle of explaining to you how to use docker on your local pc so you can test your redis based applications
locally and came to the conclusion that you dont need to replace the plugin messages. Why do you need to send messages when no player is online?
ok
so like
im trying to get the game's state
and what type
of minigame it is
so i can do like
/findgame <player> <minigame>
it searches through all the servers open currently
and checks
are they the minigame i want?
if so, it checks
are they IN_GAME, PRE_GAME, or POST_GAME?
How many users do you have?
not many, but im am future proofing
if it is PRE_GAME, it gets a list of servers that are PRE_GAME and the minigame i want
it then gets the one with the highest player count
sends em there
(makes sure it isnt full either)
if there are none in this list
it will start a new server
as the minigame i want
Then plugin messages are the wrong choice from the beginning. They should mainly be used to
get proxy related information and not for cross-server communication.
Thats a big topic i struggled for a long time. You should take a step back and explore your options.
Then build some test plugins to fully understand the option you chose and lastly build your plugin
from the ground up with the chosen approach and stick to it.
You options are:
UDP or TCP Sockets for direct connections
REST API for simple messages
In memory grid with pub/sub system like redis.
You need to explore those options and then (this important) abstract away from it.
For example: Write your own spigot events that get fired when communication is initiated.
i could try the UDP/TCP sockets
But im 99% sure that you dont need all of that because most servers can handle 50+ players if you dont bomb them with trash plugins.
what
And if the minigames are optimized and you dont even need survival then one instance can easily support 100 concurrent users.
uhm
currently
how it works
is u join in
the game starts
and when its done
it restarts
is that good
for minigames
Minigames should be build on a state machine. I would recommend you to build your minigames on one server with one world per minigame for now.
Then have a queue system set up for each minigame.
As you described the states could be something like PRE_GAME, IN_GAME, POST_GAME
yea thats what they are
wdym world per minigame
like per minigame game mode
or minigame instance
Per minigame instance
doesnt sound too bad
what if
i wanted to make a thing, where if you right click an npc
it brings up a gui where u can select like
1.9+ pvp mode and 1.8 pvp mode for minigames
how would i tell the minigame server
or well
how would i enable 1.9+ pvp
i would need another server, right?
wdym don't need survival btw
declaration: package: org.bukkit, interface: RegionAccessor
@torn oyster don't write sockets
just use redis pubsub for sending information across servers
i have a question.
Sometimes the player.teleport () method doesn't work
What should i do?
TeleportClass
public class Teleport {
public static void teleport(Player player, double x, double y, double z){
Location loc = player.getLocation();
loc.setX(x);
loc.setY(y);
loc.setZ(z);
System.out.println(loc);
player.teleport(loc, PlayerTeleportEvent.TeleportCause.PLUGIN);
}
}```
```java
for (Player player : Bukkit.getOnlinePlayers()) {
Teleport.teleport(player,0.0, 30.0, 0.0);
}
Teleport Class is not considered wrong.
Because it works fine when called from PlayerJoinEvent.
public class OnPlayerJoin {
public static void onPlayerJoin(PlayerJoinEvent p) {
Player player = p.getPlayer();
Teleport.teleport(player,lobbyCoords[0], lobbyCoords[1], lobbyCoords[2]);
}
}
(EventListener omitted )
You seem to be missing the event handler annotation
also an event method isnt static
Is adding @eventhandler a PlayerJoinEvent?
Then it has already been added and it works fine
also
for (Player player : Bukkit.getOnlinePlayers()) {
Teleport.teleport(player,0.0, 30.0, 0.0);
}```
If you call it from here, the processing after Teleport.teleport () will stop.
package dorokei.pyuagotto.dorokei;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class Start {
public static void start() {
for (Player player : Bukkit.getOnlinePlayers()) {
Teleport.teleport(player,0.0, 30.0, 0.0);
}
}
}
You can put all of your functionality in one class.
everything you have is totally static abusive
@brave glenHandler declares your method as an event handler for bukkit so its magic behind the PluginManager magically knows which method have to be called on event X
damn just tagged that guy twice
?paste

2. Put all of your functionality in one class.
3. Your event class needs to implement Listener
4. Add EventHandler annotation
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
check if the args.length != 0 instead of args[0] != null
Thats maven
not intelliJ
original is without maven depend shading and normal has it
Hello how do i can get top 10 kills using armorstands?
or holograms api
:0
thanks!
Is it possible to make a degenerate bounding box (i.e. where min > max)
But in short, use ajLeaderboard or Leaderheads
is there a way i can use a custom player head as a mat in item stack?
like is there a meta to texture it as a players head?
yes
no no
sm = (SkullMeta) is.getItemMeta()
Dont forget to .Set the Item Meta afterwards!
ItemStack playerhead = new ItemStack(Material.SKULL_ITEM);
SkullMeta sm = (SkullMeta) playerhead.getItemMeta();
sm.setOwner("Duke42555");
playerhead.setItemMeta(sm);```
What's the event for a nether portal breaking?
ok so sm.SetOwner, can i use a ver for this???
@EventHandler
public void onB(BlockBreakEvent e) {
if (e.getBlock().getType() == Material.PORTAL) {
// code
}
}```
also SKULL_ITEM aint a mat?
Read the docs
would PLAYER_HEAD work
^^^ read it Up yourself I wont do it for you
Hey there! I'm not able to find the material type of light block. Can you help me?
kk
It's a deprecation warning
a player
whoToBan = ?
You might need NMS for fully custom textures
Of Type? org.bukkit.entity.Player or what?
yup
that worked
still a player head
but i think ik whu
its bc mat is PLAYER_head
use SKULL_ITEM
oh u did?
?
SKULL_ITEM cant be resolved so idk if it is an acc mat
from the api
just checked the doc and people use (short) SkullType.PLAYER.ordinal());
BUT
that still aint wokin
Isn't Skull_ITEM legacy?
So you are running 1.13+?
So dont use legacy
im not gonna lol
But I Wonder, wth is SKULL_ITEM?
OH
Playerhead is Block and Skull Item the Item?
Yeah, SKULL_ITEM does Not exist
Has the Player been online once?
Oh lol
Did you use .setItemMeta?
Yea
. get Item Meta clones the object
Yes you do
Just make all the modifications to a single SkullMeta
how to check if a certain block is an exact block i want? i cannot use pdc
store the location
yeah i had that idea but is it really efficient
What's the context?
If you have a bunch of them just store in a hashmap
O(1) avg lookup
thats the persistent way
If it's always the same block type you can use a HashSet instead
#kickPlayer
yeh i found it
Hello! Has anyone an Idea why that does not work? The Zombie just doesnt move at all...
EntityType entityType = EntityType.ZOMBIE;
RayTraceResult rayTraceResult = player.getWorld().rayTraceEntities(player.getEyeLocation(), player.getEyeLocation().getDirection(), 10, 5, (entity) -> entity.getType() == entityType && entity != player);
Vector vector = player.getLocation().getDirection();
vector.multiply(2);
vector.setY(1);
rayTraceResult.getHitEntity().getLocation().setDirection(vector);
The location is cloned
I believe
ok so how can i add like a 2sec wait before i do a sout
like add waits between each
Look into BukkitRunnables
kk
and how can I fix that?
You can use an executor if you’re not in Bukkit
Which has scheduleWithDelay
If you’re in Bukkit you can use runTaskLater from Scheduler
Not on pc rn but there should be a setDirection or teleport function
what are you trying to do
I want to set the velocity of the player to the zombie. So if the player walks right the zombie gets kicked right,.....
so you have to set the velocity instead of the direction
if I setVelocity the zombie gets always kicked back doesnt matter where the player is moving to
since the zombie is always in the direction of the player
and so he gets kicked along the direction
just like you set it
makes sense, no?
You're never checking the direction the player is moving
Only where they are facing
is there .isAir() in 1.8.8 spigot?
hmm okay and how can I get where the player is moving to?
yes you are right I just tested it
Probably not
does anyone know how I can get where the player is moving to?
@slim kernel intellij should show you all the possible functions if you write player.
yes I know but I cant find the right one
Is there getVelocity or something similar
yes but getVelocity is only in one direction so the zombie gets kicked back everytime doesnt matter if the player walks right left or forward
Velocity should be a vector
wait im a bit confused....
how cani make this just kick the player
bc when i use p. it kicks me
Call it on the target
yes but if I do player.getVelocity() I only get 0.0, the something on y , 0.0 everytime
er
I always get 0.0,-0.07875184,0.0 for that:
Vector vector = player.getVelocity();
player.sendMessage(player.getVelocity().toString());
Why is it like this although I am moving?
the y changes a little bit everytime but x and z dont
@slim kernel try PlayerVelocityEvent then store it somewhere
it anoyes me so much because I already had it once but it somehow disapeared and I cant remember
getInstance is probably null
dont think it would be
It would
Your main class is created by the plugin loader
During the initialisation you define a field of the hologram manager type
Meaning that class is loaded by the class loader
why cant i use 1.8.8?
And you apperantly channelled all your OOP knowledge and called a static method from your main class in there
Which is before your onEnable was ever called
Just because intellij doesn't spoon feed it to you doesn't mean you can't
oh thanks, ill fix that
Have you actually tried
i tried to write it myself
What version string did you use
Dependency 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT' not found
Intellij presents you with a cute little button in the top right of your pom file
That you have to click after you modify it
So it updates it's maven model
Help i made a 1.16.5 flat world generator and now im porting to 1.17.1 its broken ```public class CustomChunkGenerator extends ChunkGenerator {
@Override
public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
ChunkData chunk = generateChunkData(world);
for (int X = 0; X < 16; X++)
for (int Z = 0; Z < 16; Z++) {
chunk.setBlock(X, 49, Z, Material.GRASS_BLOCK);
chunk.setBlock(X, 0, Z, Material.BEDROCK);
for (int y = 48; y > 44; y--) {
chunk.setBlock(X, y, Z, Material.DIRT);
}
for (int y = 44; y > 0; y--) {
chunk.setBlock(X, y, Z, Material.STONE);
}
}
return chunk;
}
}```
Ooof
and register it in main class like this right? @Override public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) { return new CustomChunkGenerator(); }
Why is the x and z 0 everytime although I am moving can somebody help me pls?
Vector vector = player.getVelocity();
player.sendMessage(String.valueOf(player.getVelocity().getX()));
player.sendMessage(String.valueOf(player.getVelocity().getY()));
player.sendMessage(String.valueOf(player.getVelocity().getZ()));
how do i make java docs appear
hey i have a problem with ArmorStand.remove() it just don't work sometimes without any reason
download them
how
How can I access the config from a different class than the Main class?
it looks like the source jar is not from maven but in fact a local jar from you rpc
You make a public variable and then access it from the Main class instance
so what do i do @unreal quartz
check ur dependencies in intellij
you probably manually added it and forgot about it
hey!
any one know y my code not working?
new BukkitRunnable() {
@Override
public void run() {
Player player = Bukkit.getOnlinePlayers().stream().skip(new Random().nextInt(Bukkit.getOnlinePlayers().size())).findFirst().get();
player.setGlowing(true);
for(Player p : Bukkit.getOnlinePlayers()){
if(plugin.a_event_p_list.contains(p.getDisplayName())){
p.sendMessage("מישהו נבחר!" + player.getDisplayName());
}
}
for (Player p : Bukkit.getOnlinePlayers()){
if(!plugin.hider.contains(p.getUniqueId())) return;
p.setMaxHealth(2);
}
plugin.seeker.add(player.getUniqueId());
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
ItemMeta swordmata = sword.getItemMeta();
swordmata.setDisplayName("killer sword");
sword.setItemMeta(swordmata);
player.getInventory().clear();
player.getInventory().addItem(sword);
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW,10,255));
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS,10,255));
ScoreboardManager manager = Bukkit.getScoreboardManager();
assert manager != null;
Scoreboard board = manager.getNewScoreboard();
Team team = board.registerNewTeam("RedGlow");
team.setColor(DARK_RED);
team.addEntry(player.getDisplayName());
}
}.runTaskLater(this.plugin, 5 * 20);```
Can you show me how to do that? I dont understand
uh how
pom.xml
?paste
You should learn basic kotlin or java before starting with Spigot
thats my pom xml https://paste.md-5.net/cunejebijo.xml
Why is optional true
No, I mean how should I access the variable
Yeah this is basics
@chrome beacon should i make it false
Javadoc can keep it just remove it entirely from the api
I want to Shoot the particle and extinguish fire at particle passed
@chrome beacon u there
Nevertheless, can you please explain how I can access it?
any one?
help
?paste thx
Explain what specifically:o
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.
@ivory sleet
https://paste.md-5.net/kasuyibato.xml this my pom
no, like when u hover over smth
Oh
it shwos the java docs
Wat
bruh
How to make entity WALK, not teleport a little, WALK like pig, horse, strider, etc
what should source be
There is nothing in spigot that allows you to do that else from the setVelocity()
.
I told you
bruh
Lmao
source, what should it be
where do i need to put <include> tags in pom?
worth a try (:
for dependecy
You shading?
https://maven.apache.org/plugins/maven-shade-plugin/ a complete guide for that
Even official
Probably want to relocate also
i dunno : (
Good way to avoid unnecessary LinkageErrors
cant i just not use it
That’s why we should use gradle btw 
its so fucking confusing
gradle goes brr
Please fix JAVA_HOME environment variable
Gradle has given me more problems than Maven
Then fix it?
Bruh
first time i've agreed with you
ill try to use the minecraft dev plugin in intellIj then just import the 1.8.8 spigot jar myslef
if you search the error the first result is literally from stackoverflow telling you how to fix it
I'm not stupid
I did that
cuz im so fucking done lmao
complex gradle can be much more confusing than maven
and this is how you got the issue in the first place
but yeah for minecraft plugins etc. it can be simple
what
Okay okay but complex maven is a disaster beyond hopes!
you've imported the spigot jar locally with contains no javadoc
every build tool is
just dont build your projects
then
wat is da solution
maven is easy
don't import the jar manually and just use maven
how do I import nms to my plugin??
Run BuildTools and change spigot-api to spigot in your pom
How to shoot white particle and extinguish fire at particle passed?
yo i think i knwo da solution
i used minecraft dev plugin then just changed the Maven: org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT
to Maven: org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT
in Libraries in plugin structure
wont that be a ez spoonfeeded solution
Or you know just open the pom and change it like a text file
just change the version string in maven
check where the arrow is and if the location of block at the arrow is fire set it to air.
idk if .extinguish() exists
Won't work for fast arrows, gotta do a raycast from previous position to next position
Could make a virtual projectile you manage manually instead of using an arrow
Then spawn particles such that they match
should this code not remove the zombies AI?
public class AggressiveZombie extends EntityZombie {
public AggressiveVillager(Location loc) {
super(((CraftWorld) loc.getWorld()).getHandle());
//setting the location of the EntityVillager in the EntityVillager class.
this.setLocation(loc.getX(), loc.getY(), loc.getZ(), loc.getPitch(), loc.getYaw());
this.setHealth(20.0f);
this.setCustomName(new ChatComponentText(ChatColor.translateAlternateColorCodes('&', "&caggressive Zomboid mf")));
//make it visible..
this.setCustomNameVisible(true);
}
@Override
protected void initPathfinder() {
super.initPathfinder();
}
}
``` or am i forgetting something (no the goal is not to remove its ai, i just tested it to see if it works and it didnt)
im at 1.16.5
it spawns just fine, but it moves like a normal zombie
oh hey turns out i do not know how to properly extend classes lol
the super isnt suppossed to be there
why would that remove the AI ?
because the pathfinder doesnt have anything in it?
i meant moving ai, but it works
Well you are not overwriting the aiStep methods or anything
so they just default to whatever the parent class defines
hello is that any way to move armorstands to view as list?
https://prnt.sc/1qa9sob
like that https://prnt.sc/1qa9t5v
my code:
if (cmd.getName().equalsIgnoreCase("topkills") || cmd.getName().equalsIgnoreCase("lb")) {
ThreadPool.SQL_POOL.execute(() -> {
List<String> top = Main.getInstance().getAPI().getTop(10);
int i = 0;
for (String si : top) {
i++;
int kills = Main.getInstance().getAPI().getKillsByName(si);
MinecraftServer.getServer()
.postToMainThread(() -> createArmorStand("§b" + "1" + ". §f" + si + " §- §d" + kills,
player.getLocation().add(0, -0.3, 0)));
}
});
}```
i just want to move armor stands
just set the Y -1?
MinecraftServer.getServer().postToMainThread <- Dont
Just use the BukkitScheduler instead
Instead of player.getLocation().add(0, -0.3, 0) do player.getLocation().add(0, -0.3 * i, 0)
no i can't
@lost matrix well thx !
look what i got @lost matrix https://prnt.sc/1qaa9kt
Oh. 3 options:
Use MutableInt
Create a new variable which is effectively final
Use AtomicInteger
Oh there is another one
i++;
final int kills = Main.getInstance().getAPI().getKillsByName(si);
final Location standLocation = player.getLocation().add(0, -0.3 * i, 0);
final String line = "§b" + "1" + ". §f" + si + " §- §d" + kills;
MinecraftServer.getServer().postToMainThread(() -> createArmorStand(line, standLocation));
for some reason this outputs
Utils.message(player, Utils.colorize(sell ? "&a+&b " : "&c-&b " + String.format("%.1f %n", amount * price) + " &3coins"));
and i'm sure amount and price have a value different from zero
sell ? "&a+&b " : "&c-&b " > (sell ? "&a+&b " : "&c-&b ")
I have 2 EntityDamageByEntityEvent Event listerns.
In the first event i change the damage e.g. to 18, if i now do
Bukkit.broadcastMessage("DAMAGE : " + event.getDamage());
the 18 is gone, so i get a other damage amount.
The order of the events is correct, the second listener (with the broadcast) will be executed AFTER the first one.
Any ideas ?
If everything is correct then what is the problem?
Oh i forgot to write that i don't get the 18 on the second listener (broadcast message)
Show both listener methods pls. Do you use priorities?
getFinalDamage ?
No raw Damage
?paste as 7smile7 said, show both your methods
uwu
(that means thank you)
no
Hm. Does every listener access the same event instance? I think so.
Meaning setting the damage should affect every following event handling.
for me it does uwu
It shoudl yes, as you can check the cancelled state in later events
😔
Can i send you the code per DM ?
I have smth rlly weird and i'm not sure if it's just a bug or what;
Just using this to get main class
private main plugin = main.getInstance();
Which apparently is null. In a different class I have the exact same and that's not null. Does anyone know wth is going on?
I'm loading the class and it just spit's out a null error when using a method in the class
?paste
why
?paste
I can't make it public as it is a customer project 😅
nobody cares
its two events of course you can post it here
The order in which you initialise the classes matters.
The customer cares 😄
initialization before declaration
Make the very first line in your onEnable this.instance = this;
I have
Then get better at java and fix your own errors. If you can;t show us the code.
First thing I do is setting the instance
after that i'm loading the classes
both classes are after setting the instance
it's weird af
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You probably have initialised variables outside of your onEnable then
you have a customer but have to ask here for help for a project which is most likely pretty simple but you still cant fix it?
^
Yeah, sometimes you have a quite easy bugs but you don't find them 😉
But i guess you never have issues right ?
post the damn code
correct. i am a god.
We all do, then we ask for help and show the problem
hmm this happens
The char is not supported by the font
@EventHandler(priority = EventPriority.LOW)
public void onDamageA(final EntityDamageByEntityEvent event) {
System.out.println("DamageA: " + event.getDamage());
event.setDamage(10);
}
@EventHandler(priority = EventPriority.HIGH)
public void onDamageB(final EntityDamageByEntityEvent event) {
System.out.println("DamageB: " + event.getDamage());
}
Resulting in:
[16:18:35 INFO]: DamageA: 1.0
[16:18:35 INFO]: DamageB: 10.0
So everything works as expected.
What version?
https://paste.md-5.net/urevijejor.md
I keep on getting this error with my MySQL plugin.
Woops wrong ping
here are my settings:
https://paste.md-5.net/oduniyejil.java
i dont see a special char in my code
You are setting the damage then reading it after changing it to alter it again for display
Wait Elgarl is right lol
event.setDamage(event.getDamage() / 100 * 150);
Bukkit.broadcastMessage("ASSASIN SET DAMAGE" + event.getDamage());```
Is what you need
You just display the wrong value
As i said.. sometimes there are small issues.. In germany we would say: "Manchmal sieht man den Wald vor lauter Bäumen nicht"
Thanks, i will test it.
Thats one example why its important to have a lot of meaningful variables even if it seems verbose sometimes.
Instead of divide by 100 and multiply by 150, just multiply by 1.5
As i said it was a minimal setup, the 150 (percent) is calculated in the method before 😄
Yes, that was the issue.
Thanks @eternal oxide and @lost matrix
clean/readable code 
@EventHandler(priority = EventPriority.LOW)
public void onDamageA(final EntityDamageByEntityEvent event) {
double initialDamage = event.getDamage();
double modifiedDamage = initialDamage / 100D * 150D;
event.setDamage(modifiedDamage);
System.out.println("Damage: " + initialDamage);
}
Custom Textures, i guess
You need a resourcepack for that
guys,
I want to replace my scoreboard's String portion, not a integer
Is there any way except making a new Objective?
EntityPlayer op = ((CraftPlayer)e.getPlayer()).getHandle();
GameProfile gameProfile = new GameProfile(UUID.randomUUID(),ChatColor.translateAlternateColorCodes('&', "&4&lFake Player"));
EntityPlayer fakeplayer = new EntityPlayer(op.c,((CraftWorld)e.getPlayer().getWorld()).getHandle(),gameProfile);
PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a,fakeplayer);
for(Player p : Bukkit.getOnlinePlayers()) {
((CraftPlayer)p).getHandle().b.sendPacket(packet);
}
can u tell me what's wrong with this code , it doesn't add the fake player to the tablist :((
where does multimap come from and how can I include it in my gradle plugin?
I believe it is part of guava
Their commons to be exact
It should be exposed by spigot API tho
not for me, but im using paper api so ill ask there
Paper should also expose it
Is there any method to start a raid
raid.start()
is there any way to kill all armorstands entites?
: )
/kill @e[type=armor_stand]
loop through the entities and remove them
or that
Entity type 'armor_stand' is invalid
Only the loaded ones. If the armorstand happens to be in an unloaded chunk then there is no way. Thats the reason why holograms with
physical armorstands are a really really bad idea.
no _
i'm using 1.8
Doesn't come up on the javadocs
hes joking
then use a plugin
Are you sure that's the way to do it
?
lmao
you gotta use nms i think
What's that
declaration: package: org.bukkit.event.raid
or, try spawning a pillager in the village
just an event
And is there anyway to have multiple raids at once
prob
he wants to cause one
make a new object?
???
nvm
Can I have multiple raids happening in the same place at once
why is google that trash atm
no
If there's a raid and I spawn pillagers in the village will they become raiders
Or is there anyway to add more raiders
I'm trying to make a plugin to cause a massive raid
just spawn pillagers
And they'll count as raiders?

no
Is there any way for me to make them count as raiders
Fourteenbruh just said it won't count
hes joking
Pillager in village = start raid
smh

just stop
hihihi
I want to create a kind of vault gui and I need to get an Event when any slot changed inside the inventory to properly safe it to prevent dupes.
How do I do this?
Cant you just save when the inventory closes and load when its being opened?
idk as it might allow dupes
I already know the case where the server reloads and the player leaves
How would it allow dupes?
If someone would take an item out and the server cant save it because it was unable to catch the closing
Oh you mean when reloading. Reloading is not supported and should never ever be done one live servers anyways.
^
owners do it tho
should pr to spigot the removal of /reload
lmao
like i really don’t know why it hasn’t been removed
I mean it already yells at you that reloading is stupid and you shouldnt do it. If you do it anyways then
its your own fault.
its good for plugin testing, finding memory leaks and quick restarts
I've had way too many people using /reload or plugman comming to our support chat because the plugin doesn't work
other than that itd poopoo
I know this isn't really the right place to ask this, I am having trouble using the SpigotAPI on my website to show a plugin's version. It is denying access
dony use legacy
what should I be using
non-legacy 🧠
Getting the same error any way
<div id="plugin-version">
</div>
<script>
$(function(){
$("#plugin-version").load("https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=91015");
});
</script>
This code will work on any other website
I think it's to do with Spigot's cloudflare
@jade perch
wtf
But... I have to manually put the version in
I changed the link
I want to get the latest version
new one only requires resource
How can I extract just the version from that
it's JSON
Moshi tho
no
Yes
no
Gson ded
yes actually
ThAtS NoT gOOgLE
No it isn’t
oh wait@
But it’s from someone who was developing gson
i didn’t see dev xD
well
i think i know why you like it
“Upcoming Kotlin support”
lmao
That’s a bonus nevertheless
(() =>
fetch("https://api.spiget.org/v2/resources/91015/versions/latest")
.then((response) => response.json())
.then((json) => json.name)
.then((name) => console.log(name)))();
convert that to jquery or whatever, but that's how you extract it
looks like a Stream#map
why leave java
and spigot
How to replace an item in the GUI with another item with a name when clicked?
I haven't left I still maintain hpwp and i'm working on a new plugin -.-
Thank you! But how would I get around setting this as a div
I want to replace my scoreboard's String portion, not a integer
Is there any way except making a new Objective?
Hello, i have some problems with maven and spigot 1.8.8 could someone send me a working pom.xml?
Show your pom
Wait
Listen to the inventory click event then change the item in the clicked slot
give some element an id with resource-id
then:
(() =>
fetch("https://api.spiget.org/v2/resources/91015/versions/latest")
.then((response) => response.json())
.then((json) => json.name)
.then(
(name) => (document.getElementById("#resource-id").innerText = name)
))();
I didnt even want to send this message fixed it some time ago thank you tho :)
yes, but what is this event for changing the subject?
Inventory#setItem
Thank you so much! 🙏
event?
I assume they mean method
I am speeed
this is a problem with the configuration on spigot's end and you can't do anything about it
setType(Material.AIR) works, but how do I give a name to the changed item?
Air can't have name. Anyway use ItemMeta to change the name (see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/ItemMeta.html)
and how to use it? I wrote the air for an example
Use getItemMeta on the item then set the display name and then set the ItemMeta back on the item
Does anyone know the 1.17 method to convert from Material to nms IBlockData
In 1.8 it's nms/Block.getByCombinedId
I tried, but it didn't work out
1.17 has that method as well, but I fear it won't work with the modern Material
Show what you tried
seems like a question for the paper chaps
Mmk
What protocollib packet could I use to detect player movement?
If I use REL_ENTITY_MOVE and simply this piece of code;
@Override
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
Bukkit.broadcastMessage(String.valueOf(packet.getBooleans().readSafely(0)));
}
it detects all entities expect my player which is weird af
xD
Please fix JAVA_HOME environment variable.```
listen InventoryClickEvent
i need it for forge
stupid forge
As imagine says set it in Intellij or do what the error says and set the JAVA_HOME enviroment variable
wdym stupid bruh
Forge is good
too much work ill use imaginedev thingy
also imaginedev what shit r u saying rn
fabric is way worse
Don't use setType
event.setCurrentItem
if ItemUtil creates an item for you use setItem
bump
is there any way to "un" generate a chunk to save disk space?
There is no native method for this. You would have to write your own code to delete chunks
@chrome beacon
and he is back..
and that code would be?
https://c.radikal.ru/c10/2108/54/6274b4daa94b.png
ItemStack clickedItem = event.getCurrentItem();
I know that the WorldBorder plugin can do this. You can take a look there
maybe deleting mca files inside the region folder? idk
Olivo I warn you too not borher with the guy that pinged you, he doesn't even seem to understand english (not harassing I am serious) because he never listens and doesn't do what you say, he has pinged around 5 people with the same shit multiple times.
no
and how are we supposed to know what you are trying too do?
An mca file contains multiple chunks
Because what you said didn't work and I checked it
what?
I never said anything and you never provided information
all you say is "not work" "not working" "not worked"
Use POSITION or POSITION_LOOK
this was when I asked how to take the experience from the players
you didn't provide info now either
I wrote above
reply to it
.
don't really understand what you mean
It should work 🤔 Try asking Paper about that
I am not going to deal with you again anyway, I am moving to the chill place.
u been given the answer 3 times
no, there are no such methods
😐
I need to replace this item with another one with a different name when clicking on an item in the GUI
https://c.radikal.ru/c10/2108/54/6274b4daa94b.png
ItemStack clickedItem = event.getCurrentItem();
dw, you can ping choco and he won't care.
I also sent a link in which a screenshot with possible methods
the mods are chill
dude
that is the answer
there is no such method
event.setCurrentItem(the new item);
There is
setClickedItem then?
No it's setCurrentItem
Hello I am tal-king clear-ly now, use this: event.setCurrentItem <---- use that ok? this: event.setCurrentItem.
Maybe he's on an old version
I don't think that has changed
Or the event is the wrong type
@quaint mantle https://hub.spigotmc.org/javadocs/bukkit/
package index
how do I write this? have you seen the screenshot?
Use a keyboard
yes.. you are trying to do it on the clickeditem..
witch is not the event
^^
This is kinda funny ngl
also this ^
key-board
it's the thing that you type on
it's is short for "it is"
clear enough?
event.setCurrentItem(ItemUtil.create(Material.STONE, "asd"));
it works, thank you very much
congrats!
So having a problem after saving message.yml file
after file is edited
and all lines are inside double quotation marks
after u save
they are back to single quotation marks
which is some cases brakes config
single is the correct format
Not if you read the file correctly
you have to escape ' if you want to use it in a string
after file got saved because there was added some values
well that happended after auto update of config
So, I'm currently trying to Replicate the Spigot Annotation Processor and I have Issues narrowing down how to get the plugin.yml File. From what I can tell, the Spigot one uses a RoundEnvironment to get the File but I couldn't find any good Info on how to get that one. Any Help is greatly appreciated
There is no auto update on configs
well I do have a method
which added missing lines
and then I save it
your original file is wrong, you have to escape the ' to use it in a string in yaml
Anyone here have any idea how to connect a minecraft plugin to an external Node JS server?
Tytyty I am trying to get my head round Sockets atm 🥲
I am wanting to upload chat Log files to a Node JS server
maybe is there some way of saving yml with " "
Just format it correctly
Aight is there anything in particular you're stuck on?
Eh all of it right now but i should be ok, using sockets should work for that right?
yes, \ before '
I just gotta take some time to sort of comprehend all the info i am reading lol
just got back from work so I am very tired
that is so retarded
xd
and u need to use it at front of the most special carracters
I think
or am I wrong about
it
@eternal oxide
Yes Sockets should be perfect
only characters that can terminate a string
like ?
oki thank you so much!
no
I mean like which one
' and " mostly
\ before '
and what for example
if you want to use \n
as I remember that is not working
with ' '
escape characters are fun
with an extra \
\\n will display as \n
I have both jdk 14 and jdk 16 installed and i want to build spigot 1.15.2 using buildtools but it keeps using java 16, is there a way to force it to use java 14 ?
?google set java home variable
Google your question before asking it:
https://www.google.com/
Instead of starting the command with java use the path to the java.exe
okay thanks
that works too
This may be a dumb question but if I have a packet on the protocol wiki, how can I get the PacketType from protocollib for it?
i didn't know what terms to google, else i would've done it
Setting Java home gets quite annoying if you have to keep swapping it
set java home variable
wdym?
You mean wiki vg?
I usually just guess but you can find the correct internal names here: https://github.com/dmulloy2/ProtocolLib/blob/master/src/main/java/com/comphenix/protocol/PacketType.java#L106

