#help-development
1 messages · Page 1483 of 1
Yes
you need to set the path too
make sure to restart your shell after modifying the path
that doesn't test whether a player moved a block, anyway
it doesn't?
but the maven dependcy
that tests whether the player's last move packet caused the player to move more than 1 block of distance in any given direction
hmm
if you want to check whether the player has moved to a new block, check if location.getBlock().equals(oldBlock)
i tried that
thats not related
use maven
google "how to shade with maven"
It says u will also need to shade the libary into your plugin jar file
what are you even doing
^
Shading is like
including the libraries into your jar
but currently your first problem isnt fixed
so dont even think about shading
show us full pom
?paste
<dependency>
<groupId>co.aikar</groupId>
<artifactId>acf-paper</artifactId>
</dependency>
bruh
do you see something missing?
You are missing the version
how can I make EntitySnowball invisible?
tag
I'm having a problem with using my arenaConfig file (https://paste.md-5.net/qesiyiweti.cs). I've done so it's not much static in it but more constructors but I can't seem to be able to actually get the config or anything. This is how I get it in my main class: https://paste.md-5.net/idunefamak.java and I use this line when I register my event: pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);. This is also how it looks like in the event class: https://paste.md-5.net/adizotugal.java
show new pom
i cant find the class in Spigot. I just see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Snowball.html
declaration: package: org.bukkit.entity, interface: Snowball
are you using intellij?
do you see this reload button
when you enter the pom file
I ammmmmmmm
try running the command again
if that doesnt work, invalidate caches and try again
thats my best advice from the information so far
acf-paper definitely is in the listed repository
Ok right so
Well i looked at the other options
i put acf-bukkit
in the thing
rebuild
and it worked...
so it was acf-paper
all a long
You know, its platform dependent right?
Yes
you cant just smack a random version and use it
but..
and also as mentioned above, it seems to exist
Why are you using paper then if you are working with Spigot?
you use paper when using paper
spigot when using spigot
etc
not like paper for spigot
How could I use a symbol like this ➤ in mc?
UTF8 codes
Make sure your file in encoded in UTF8
it does and you can use it
this has nothing to do with spigot or paper
your maven simply cannot find the listed artifact in the listed repository
even though it exists
when I use it this happens https://imgur.com/rEhpUEW
unicodes
ensure your file encoding is utf8 and you are both reading and writing it with the same encoding
wait if a itemstack item is used to make that entity like a snowball. throwing a snowball item makes a snowball entity, is it possible to get the item of which caused the entity to spawn manually? like a trident entity can be spawned by throwing a itemstack trident. can u make a itemstack object = the cause of what threw the snowball or the snowball item.
doesn't work for snowballs, no
I upload minecraft videos to pornhub and was wondering if u had any advertising advice
if its not been altered https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/ThrowableProjectile.html#getItem()
all snowballs are the same as far as vanilla is considered
i don't know if the functionality used by tridents and such is implemented under the hood for stuff like enderpearls and snowballs
you can try it I suppose
Hi, someone has a nice Skywars ?
no
I need help with an API it say it couldn't find the package but I imported the API into IntelliJ its a Maven problem
If using maven you don;t import anything, you add all depends in your pom
heyo im tryna make a hide and seek plugin and i am getting this error when trying to use /has start org.bukkit.command.CommandException: Unhandled exception executing command 'has' in plugin hideandseek v1.0
yeah that tells us nothing
We need the stacktrace
include the whole exception, with its stack trace
stack trace?
"at blah blah"
All the console error
🤦
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getPlayers()" because the return value of "org.bukkit.Server.getWorld(String)" is null
Introduction:
It has come to my attention, recently, that a lot of new developers do not understand the true reason of a stack-trace: Trouble-shooting...
literally read
sorry man
has anyone messed with PAPI (PlaceholderAPI) ?
Lots of people I expect
I'm trying to figure out how to add support for it into my plugin. My plugin adds levels to mobs and it's been requested that I provide a %level% placeholder.
It looks like I would need to return the level from the onPlaceholderRequest function as seen here: https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion
but I'm confused on how I would know what mob it needs it for
Placeholders are based upon a player
ah that makes sense
where did these people want you to add a %level% placeholder
you probably want to write some String::replace logic in your actual plugin
specifically it was requested when a player kills a mob they want some plugin of theirs to broadcast mob blah (level x) was killed by player
and they want my plugin to make the %level% PH available so they can tap into that
yeah that's not really feasible
you can't do a placeholder but you could easily add an event
of course that would involve the other plugin listening to that event
that's true. I do have a few events already
yes, but they are already listening to events so no different
yes that is likely
Make them work for it, bury it in an obfuscated API, nested deep in your codebase 🙂
well
there is a way to do specifically what they want to do
have a last_killed_level placeholder
and set it every time the player kills something
and tell the guy to use it in the message
is it possible to stop an entity from turning its head? But only when the turning is is called by the in-game AI and not though a plugin?
kind of cancer but should get the job done
That is a good idea and might just work
Removing its AI
ok
its the first time that im working with api's so can you explain it to me how i do it pls
Or cancelling its EntityTargetEvent
surely not the first time
or are you here, in the spigot development support discord, without ever having used spigot api
adding dependencies to your pom is basic maven stuff. You need to google and learn that yourself. I'm not a tutor
but then it won't take any kb?
but the wither still moves it head randomly
can I add a mob to a scoreboard team?
How can I fix this issue 'Reload(me.jtx.water.Water)' in 'me.jtx.water.commands.Reload' cannot be applied to '()'
i should be able to
yes, you add them by UUID as a string
It's saying that its related to this public Reload(Water plugin) { this.plugin = plugin; }
.addEntry?
you learn java
that is how you solve it
so, let's take it from the top
'Reload(me.jtx.water.Water)' in 'me.jtx.water.commands.Reload' cannot be applied to '()'
'Reload(me.jtx.water.Water)' refers to the method you want to be calling
the method that exists
me.jtx.water.commands.Reload refers to the class the method is in
'()' refers to what you are trying to do
so, in english
the "Reload" class has a constructor
the constructor has a parameter
the type of that paremeter is Water
however, you are not giving it any parameters
you need to give it a parameter of type Water
is there a server reload event
you mean to detect if its a fresh start or a reload?
there is one yes iirc
i remember a meme going around about listening to said event and shutting down the server
@Override
public final void onEnable() {
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
}
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Message");
out.writeUTF(player.getName());
out.writeUTF("hello from another server!");
Bukkit.getServer().sendPluginMessage(getInstance(), "BungeeCord", out.toByteArray());
shouldn't this be enough to send a message to a player from another server?
because it doesnt do that.
reload
also why am i still getting pushed
me and the wither are buddies
we are in the same team
what? You didn't answer the question
so I would do Water.this
if you want to detect it ```java
@Override
public void onLoad() {
if (Bukkit.getWorlds().isEmpty()) {
System.out.println("Fresh Start");
} else
System.out.println("Reload");
}```
okie
thx
can I use enum as String?
does any1 know
Enum.valueOf?
Enum::name
Im trying to do
enum Colors{
Green("§a")
}
Or Enum::toString
what does that mean
it's a method reference
create a constructor
call toString on it
I would want to just be able to do
p.sendMessage(Color.red + "hi")
that will automatically call toString on Color.red
Colors.Green.toString()?
I see
because you are using the string concatenation operator +
if fr some reason Color.red isn't working?
y am i getting pushed by the wither can someone help
why rn't u using ChatColor.RED +
however you can't do Color.red + Color.bold
because neither Color.red nor Color.bold are strings
and therefore the + operator isn't cocatenating strings
but I can do Color.red + Color.bold + ""?
yes
as long as 1 string is in there it's fine
myes
or else I would need valueOf
no reason to be using Color.red + Color.bold alone anyway
Have getCommand("reload").setExecutor(new Reload(this)); but I get a java.lang.NullPointerException public Reload(GoNick plugin) { this.plugin = plugin; }
Why are you remaking the chatcolor enum
Color.red.toString() + Color.bold.toString()
Is it in your plugin.yml
yes
getCommand only retrieves commands declared in your plugin.yml
that won't change the executor on bukkit:reload
nor will it override bukkit:reload as the primary command for /reload, iirc
reload implements CommandExecutor?
add its uuid
yea I have that
yes
ok so it looks like it fixed itself but the command doesn't even work itself apparently and no errors
yeah no errors
./reload will be directed to /bukkit:reload
yea
I mean what is it meant to do
reload config
you probably want to add it as a subcommand instead
./myplugin reload
instead of having to
./myplugin:reload
since a lot of people don't know about namespaces and it isn't exactly intuitive
create a main command and then see if one of its arguments matches with a subcommand
if (args.length > 0 && args[0].equalsIgnoreCase("reload"))
what if someone does /command reload pls
nothing will happen
you absolute fool
why would someone do /command reload pls
i don't know, but wouldn't your plugin look stupid if nothing happened if they did?
anyways
setCancelled(true)
if (label.equalsIgnoreCase("water")) {
if (sender instanceof Player) {
if (args[0].equalsIgnoreCase("reload")) {
this.plugin.reloadConfig();
player.sendMessage(ChatColor.GREEN + "Reloaded!");
}
}
}
``` that's an idea on how the reload command looks like
don't use label
label could be anything
the label is the alias of the command that was used
dont use label, use Bukkit.shutdown() instead
What should I use then
command.getName
f.e I could go in commands.yml and create an alias "water2", and point it at your water command
and then I run /water2 reload
and nothing happens because label is "water2" and not "water" like you'd expect
oh ok
I feel like this is messing with it getCommand("water reload").setExecutor(new Reload(this));
i would be very surprised if that worked
so lets think, what is WitherSkull and why do you think it's underlined
and what is it supposed to be
I mean no errors happen but its like it just ignores it
?paste
uhh
why won't it work tho
Could someone help me with this error:
https://paste.md-5.net/aserenilah.bash
This block of code provides that error (ive almost never worked with iterators so I could be doing a rly dumb mistake):
Iterator it = ChickenMap.runnablePerChicken.entrySet().iterator();
while (it.hasNext()) {
ChickenMap.runnablePerChicken.get(chicken.getUniqueId()).stop();
it.remove();
}
what is WitherSkull
a entity?
What should I do instead of that?
not just WitherSkull
the class of witherSkull?
so what should you put instead of just WitherSkull
no
that creates an Object of type WitherSkull
you want an object of type Class<WitherSkull>
an object that represents a class
okie
instance.getClass()
how do I have an enum for all the classes that extend from one
he needs to figure out what to do himself
Oh it wasn't a question xddd
that gets an object that represents a class, from an object
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!Utils.checkPlayer(sender))
return true;
Player p = (Player) sender;
p.kickPlayer("");
return true;
}``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
what we want is to get an object that represents a class, from the class
like
MeleeWeapon extends customWeapon
RangeWeapon extends customWeapon
and if I want a enum for them, what do I do
witherskull.getclass?
no
no, getClass is an instance method
you want the static Object field
in order to call getClass, you first require an object, because it's an instance method
so getClass is off the table
we want to get it directly from the class
I tried WeaponType(Class<CustomWeapons>) but it just says i provided the wrong class when i give it MeleeWeapon even though it extends from CustomWeapon
is that not how it works
Oh is he trying to use spawn with the class ?
myeah
I enjoy telling 1.8 developers their version, API and server is not supported
classic spigot xD
Sounds like a task for me /s
i have a list
Oo
i've started to collect a list of 1.8 users who've asked for help, along with their user ids and the topic they were on
i'm going to put together a 1.8 community
lmao
and then have the 1.8 fucks quarantined into it
Quick find their uuids too
implying any of them have bought accounts
is this better java if (command.getName().equalsIgnoreCase("water")) { if (sender instanceof Player) { if (args.length == 1 && args[0].equalsIgnoreCase("reload")) { this.plugin.reloadConfig(); player.sendMessage(ChatColor.GREEN + "Reloaded!"); } } }
no its command
it was label before you edited it
now how should I put it in my main
like water reload
getCommand("water reload").setExecutor(new Reload(this)); or getCommand("reload").setExecutor(new Reload(this));
Probably just water
neither
uh so then what would I do?
very good
yay
if neither
"water"
I got a command already named water
Then delegate a sub command to reload your plugin?
hm?
Let me ask you this, what are you trying to do as of now?
get the reload command to work
so theres two different wither skulls
No the entire project you’re working on
oh just a book that you can edit stuff in
they are the same entity type but with some different flags or data or something
in the docs
see the docs of WitherSkull itself
ohh okay
Did you check the methods of WitherSkull
similarly to how there are like 20 different villagers
charged hmm
but only one villager class
does that change the color
probably yes
also how do i add a mob to a team
add its uuid to the team
i found aboslute nothin on google
Why did you need a reload command?
oh wait do you add it as a player
it reloads config.yml
Oh so what commands do you have currently?
.
and a thing that makes a book
So
/water
makes a book
/water reload
reloads config?
hmm how can i launch a blue wither skull
the methods are in the object of the witherSKull class?
Check the return type of launchProjectile
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!Utils.checkPlayer(sender))
return true;
Player p = (Player) sender;
p.kickPlayer("");
return true;
}``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
it returns the luanched projectile
ohhhh
so do stuff to that
okay thx
What events do I need to listen to in order to have a reliable database -> block position reference
like I need to keep an accurate track of a block in a database, to store some custom data
Place, Break, Explode, Piston, Change, etc
like is there a definite list, because there are just so many ways a block can disappear from the world, be moved, etc
why not use RedLib for data blocks
Does anyone have something that serves as a reference for me to make my multi-language plugin?
I mean ideally you’d use resource bundles which essentially are made for localization
im not using redlib for this @sage swift, but I know it exists
though thats a good question
how do I make an enum's constructor take extends of a class
@waxen plinth have u looked for every event necessary to see if a block has changed
Elaborate
like A and B both extends C, and I want enum D's constructor to take any class that extends C
well there's block.setType which doesn't call an event at all
Just specify the type C?
only so much you can do
Class<C> or C
why doesnt it call an event :<
neither does setting an item in an inventory
Because yes
You got an idea or????
An instance of C then just use C, if the class then use Class<? extends C> since it could be any subtype of C in that case
Just mixin in an event for it
how?
public enum WeaponType {
Melee(weaponType.Melee);
CustomWeapons weapon;
WeaponType(CustomWeapons weapon)
{
this.weapon = weapon;
}
}
here weaponType.Melee extends CustomWeapons
It doesn't
Yeah
But you can ask MD nicely for them :p
public static void networkLog(String message) {
List<String> uuid = sqlData.fetchList("UUID");
if (uuid == null) return;
Bukkit.getScheduler().runTaskLater(instance, () -> {
for (String p : uuid) {
OfflinePlayer player = Bukkit.getOfflinePlayer(UUID.fromString(p));
if (getPermissionValue(player) >= 3) {
sendNetworkMessage(player.getName(), replaceChatColors("&b[STAFF] &r" + message));
}
}
}, 5);
}
public static void sendNetworkMessage(String p, String message) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Message");
out.writeUTF(p);
out.writeUTF(message);
Bukkit.getServer().sendPluginMessage(getInstance(), "BungeeCord", out.toByteArray());
}
why would something like this cause a message to be sent twice to the same player? uuid does not contain 2x of the same player/player's uuid.
and weaponType.Melee gets underlined saying Expression expected
Well create a CommandExecutor for the command node water then use arguments as a way to determine sub commands
Is weaponType a class or it might be the case that you haven’t defined what weaponType is
How can I put items with meta data in crafting recipes? I am using Spigot-API 1.12.2
Does 1.12 have exactchoice?
No
How though?
im confused, how does one mixin a custom event to a method if mixins arent in spigot 😔
Like I said
The essential would be that, but doing config.set () magically removes the separations
Ask MD nicely
USE 1.16.5 LMAO
unsupported versions outta here
i am using 1.12.2 because its stable.
as is 1.16.5
so is 1.16.5
Keep a list or an array or whatever of the recipes items, and compare them to the items from the event
isn't that what I did here ```
if (command.getName().equalsIgnoreCase("water")) {
if (sender instanceof Player) {
if (args.length == 1 && args[0].equalsIgnoreCase("reload")) {
this.plugin.reloadConfig();
player.sendMessage(ChatColor.GREEN + "Reloaded!");
}
}
}
on the contrary, 1.12 is full of unpatched and known exploits
as software several years out of date tends to be
Bukkit.getOfflinePlayer(wither.getUniqueId())?
No
correct answer being?
you dont addPlayer on a mob
addEntry takes a string
it's in the method name
add the uuid
yes
Conclure
dont think add entry works
any idea why it wouldn't work?
i tried but i can still hit the wither
"you tried" what
addEntry takes a Player name or an Entity UUID.toString
what do i do when i compare them?
getUniqueID returns an UUID
isSimilar should work
yes
nullpointerexception
you can't convert nothing into an UUID
you need to give it a String
right now you are not giving it anything; you are passing it a variable without any contents
hmm it should benn able to retrieve a value
map.put(player.getUniqueId().toString(), wither.getUniqueId().toString());
Wither w = (Wither) Bukkit.getEntity(UUID.fromString(map.get(e.getPlayer().getUniqueId())));
why are you storing them as strings
should i store it as UUID?
yes
don;t uuid take more space than strings?
okie
and UUID is like 32 characters right
a uuid as a string is a minimum of 72 bytes
plus the cached hashcode
so yeah use UUID
also, size is irrelevant
you should use the correct type
if you need to store an UUID, store an UUID
if you need to store a String, store a String
I used to store strings over a reference
okay
No idea why
there are a handful of exceptions
like Player
Players are kind of fucked and transient and nasty, so you generally don't want to store them at all
being fucked and transient and nasty is a good reason to use something else, like a UUID
Couldn't you store them as a weak reference
Yeah
You can but Player is not persistent whereas the UUID is
that is how you add it
Not every single one for data blocks
But for my protection policy I have
i can still fricking hit the wither
and im still getting pushed
what options have you set on your team?
For data blocks I kept it pretty lightweight but I'm open to adding more if needed
you can store them as a weak reference yes, but that only works when querying with player instances you obtain externally
anyone know why java Bukkit.getServer().getClass().getPackage().getName()
returns : org.bukkit.craftbukkit.v1_16_R3.v1_16_R3
weak references aren't dropped the instant the object becomes unreachable
But the important thing is that you can just check the type when you check the block as well and it should be fine
Because blocks can be removed by plugins
meaning that you can still have stale player objects in your collections
on latest spigot from build tools
So you will never get everything
which you might then iterate over, and run into issues
What would you expect it to return?
but, it's fine as long as you are mindful of it
org.bukkit.craftbukkit.v1_16_R3
NMS versions != Minecraft versions
Ah
although the same could be said for just storing the players directly, but whatever
what's tinyprotocol
uh
protocollib but gay
protocollib sort of
is it just like protocolLib lite?
not really
it just hooks incoming/outcoming packets
and provides a callback
so you can modify the packets
without depending on protocollib
Oh I used to have something like that in my library
I removed it because it broke jitpack 🙃
i mean i cba to reinvent the wheel
I'm too lazy to set up my own CD
so like an alternative to protocollib?
its made by the same guy
managed to create this 😄
forgot to write the amount of airblocks in a chunk
I don;t see any collision rule
anyways anyone have a clue?
oh so i need to set collision
i thought it was default
but still i can hit the wither
Not sure you can prevent friendly fire on a Mob in a Team. Are they even friendly to you?
that's semantics
ohhhh okie
down syndrom spigot jar
Just add some data to the wither and use the damage event
I mean worst case coll, I could just make a patch that makes Block.setType and any other api methods call a method
no?
how do I make an enum with classes
your jar is shading in extra chromosomes
Sure, but then you need a separate jar
note that both entities need to have collisions set to false for them to not collide
as collisions are 2 way
unless it's a projectile, which only does 1 way collision lookups
thats fine, it's a personal plugin. though I've never patched, pr'ed, forked, or downloaded spigot so I have no idea how I would do such a thing LMAO
since spigot is closed source 😔
wait what
No it's not?
spigot is closed source??
we had a whoel convo on this yesterday
bruh I was aboutta send this link
you need to sign a contract to see everything
Not the code
like you cant find the api methods or anything
But yes you do need to sign it to see PRs
we can already see everything
🤔
wait normal vanilla wither skulls don't have gravity
someone said it was closed source literally yesterday
well they are dumb dumb
Someone is having big lag problems with my plugin, specifically the PlayerJoinEvent
https://github.com/JustDoom/Better-Messages/blob/main/src/main/java/com/justdoom/bettermessages/events/JoinMessage.java
What could be causing this?
Don't use this method
I have no idea what it's meant to do
I had tried to use it once to make it so that players wouldn't push each other around
All it did was make them unable to be hit by arrows for some reason
would that be the cause? if so how would i make it async?
both entities must have them disabled for no collision to occur
however, projectile collisions are one-way
if a player has collisions disabled, projectiles will not collide with them
can I have an enum represent a class?
That sounds very annoying to work with
it is
@digital plinth team.setOption(Team.Option.COLLISION_RULE, Team.OptionStatus.NEVER);
Calling setCollidable(false) on every player did not prevent them from colliding
As in they would still push each other around
okie thx
that is because player movement is clientside
and the player doesn't know about the server-side collidable flag you've set
collisions and the movement caused by them is still movement
i don't know about the collidable exemptions thing
it must be new
i don't remember seeing it last I fucked with collisions
?paste
can anyone help with this error https://paste.md-5.net/gahibudeje.js
because your runnable runs 80 ticks later ?
code outside the runnable just runs through
blocks.onBlockPlaced(REDSTONE_WIRE, function () {
for (let index = 0; index < 4; index++) {
}
})
here what i got how do i nake it broadcast to people with certin perms something like user has placed 4 redstone
ohhh
okay i fixed it thx
Making a mob morph plugin I see
can anyone help
no helping allowed
Is there a maximum number of characters allowed in an inventory title?
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!Utils.checkPlayer(sender))
return true;
Player p = (Player) sender;
p.kickPlayer("");
return true;
}``` and this give me this warning in console ```
handleDisconnection() called twice``` how I can fix this?
that error makes no sense
how can i use PrepareItemCraftEvent for custom items in recipes?
I don't understand
^
compare with isSimilar
Do note isSimilar ignores stack size, but not durability
uhh so the only way to stop collisions is by using packets?
what do i do after i check though
only warning but how fix this?
You haven't given enough information to comment. The section of code seemingly has nothing to do with the warning you posted.
HOW fIX
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!Utils.checkPlayer(sender))
return true;
Player p = (Player) sender;
p.kickPlayer("");
return true;
}``` self kick give warning
what is the full warning?
[23:21:55 WARN]: handleDisconnection() called twice
That's not a problem I think ...
This message just indicates that a plugin try to disconnect you twice
Its a problem with using 1.8.8 https://www.spigotmc.org/threads/handledisconnect-called-twice.74171/
I don't think, I had some 1.8 servers and i've never seen this message
look at teh linked thread
that's what I'm doing x)
I have 1.12.2
Fixed in Spigot https://hub.spigotmc.org/jira/browse/SPIGOT-1133
Its because its trying to kick the player twice
it aint really that much off and issue
doesn't effect the plugin at all
I kick player only one time
Its nothing to do with your plugin and theres nothing you can do to fix it, other than updating.
1.12 is the worst version
why?
because it sucks
xD
@wraith rapids Alright so I did what you said and made it into a sub command but the issue im running into is when I register Reload as a sub command I need to fill in the method with Water but I tried doing Water.class that didn't work.
i have made the code in my playerjoinevent async but now this wont work
event.setJoinMessage(null);
Don't make that part async
Bukkit.getScheduler().runTask(plugin, () -> event.setJoinMessage(null)); ?
um can plugins detect player pressing wasd
Wont work
Just don’t wrap it in a task
@proud basin learn java
Thanks
i don't have the effort to go on a "what is oop" tangent right now
No one said you needed too
well then there will be a lot of lag from sql
AsyncPlayerPreLoginEvent?
^ Do your sql lookup in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/AsyncPlayerPreLoginEvent.html Then have the result ready if you need it for the login
ooooo, thanks ill do that
um even after i set collision to false for both entities they are still colliding
y?
cuz the client don't know collision is disabled?
also can you make an entity invisible to one specific player?
Have you set your collision and the entity collision off?
However the Scoreboard Team collision should be enough
yes both are off
im still colliding with ppl on my team
mobs on my team*
add the player by name
how do i when event triggers it msg everyone with certain perms that it happned
addPlayer is deprecated
so .addPlayer(player.getName)
okie thx
its deprecated doesn;t mean it don't work
yea i am stil getting pushed
ok i want so when an entity gets tamed it notifies staff how would i do that
onTamevent or something
Have you set the Scoreboard for the player?
does no colision don;t apply to mobs
yes
i just dont get it to notify staff
I've not tried
but I can, one sec
no collision with mobs is workgin for me
join palmergames.com:1 to test
:<
will packets be able to stop collisions
what games has palmergames produced
palmtree game
You don;t need packets, only Teams
I just tested it and with collisions off there are no collisions between players and mobs in teh same team
oh
so this code works
he wither is constantly getting tped to me
is it bc of this?
that im geting pushed
I'm not
?
see for yourself. join server
I have all mobs added to teh same team
I disabled friendly fire. I can still hit the mobs but they take no damage
?paste
for(Player p : Bukkit.getOnlinePlayers()){
if(p.hasPermission("perm")
p.sendMessage("Your message");
}```
okay so your code worked
mine is like
the exact same
.
is it because im constantly teleporting the wither to me that im getting pushed
hold up maybe im not geting pished
so when I stay still
i don't get pushed
but when I move i like can't seem to stop the velocity
i keep moving
went i try to connect send me this: io.netty.channel.AbstractChannel$AnnotatedConnectException
ok
Where can I put my minecraft skin so that they give me the plugin code?
What are you doing in your code that affects velocity?
MineSkin.org allows you to generate skin texture data for Minecraft which is signed by Mojang.
nothing really
that?
yea but what is it doing and how to fix. If I set the collision to false everytime the wither tps
would it fix it
testing...
are you trying to hide inside teh wither?
yea
You are not going to be able to left or right click
i can?
Sh*t it didnt work
You will hit the wither
Pretty sure getDirection clones internally
it does
You might wanna use setDirection
Not sure if a teleport is actually needed for this
I think it would be appropriate tho
wither.setDirection?
Basically you construct the correct location
And then teleport the either
Wither
wdym construct the curren location
yo
anyone has anyidea why i cant spawn skull as a falling block?
No errors, it just never spawns
skull = new ItemStack(Material.PLAYER_HEAD);
skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwner("Nuxoria");
skull.setItemMeta(skullMeta);
fb = (FallingBlock) chicken.getWorld().spawnFallingBlock(new Location(chicken.getWorld(), chicken.getLocation().getX(), chicken.getLocation().getY() + 1, chicken.getLocation().getZ()), skull.getType(), (byte) 20);
fb.setGravity(false);
fb.setInvulnerable(true);
might just be the client that decides not to render it
does that create permission?
you sure?
complex blocks like skulls and liquids don't work with falling blocks; the client can't render them
aight
it goes through all players, and if they have the specified permission, itll send them the message
you could just chicken.getLocation().add(0,1,0)
how do i give someone that permission i dont see it in lp editor
idk what that is, try adding it in the permissions in ur plugin.yml maybe it reads that idk
gotchu, ty.
are you on an old Spigot or something? using a deprecated spawn method
I mean i just wanted to spawn a falling block
didnt pay attention rly
which one
does it affect something?
im on the newest spigot
then use the one that doesn;t use magic num,bers
try (untested) ```java
Location loc = chicken.getLocation().add(0,1,0);
ItemStack skull = new ItemStack(Material.PLAYER_HEAD);
SkullMeta skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwningPlayer(Bukkit.getPlayer("Nuxoria"));
skull.setItemMeta(skullMeta);
loc.getWorld().spawnFallingBlock(loc, skull.getData());```
modify to simplify
How can I find the unicode for —
yeah skull.getData seems to fail
since it asks for a block
I mean the error is that it must be a block
Caused by: java.lang.IllegalArgumentException: Material must be a block
points to the line
you are using the wrong method. you still have a data byte on the end
no i dont
show code
public DeliveryBox(Chicken chicken) {
skull = new ItemStack(Material.PLAYER_HEAD);
skullMeta = (SkullMeta) skull.getItemMeta();
skullMeta.setOwningPlayer(Bukkit.getPlayer("Nuxoria"));
skull.setItemMeta(skullMeta);
fb = Bukkit.getWorld(chicken.getWorld().getName()).spawnFallingBlock(chicken.getLocation().add(0, 1, 0), skull.getData());
fb.setGravity(false);
fb.setInvulnerable(true);
}
change Bukkit.getWorld(chicken.getWorld().getName()) to chicken.getWorld()
it shows no error here, but I've nto run it
oh i found a very interesting fix to this
if i tp myself to an unloaded chunk
i don;t see thr wither anymore and i don't get pushed
I'm having a problem with using my arenaConfig file (https://paste.md-5.net/qesiyiweti.cs). I've done so it's not much static in it but more constructors but I can't seem to be able to actually get the config or anything. This is how I get it in my main class: https://paste.md-5.net/idunefamak.java and I use this line when I register my event: pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);. This is also how it looks like in the event class: https://paste.md-5.net/adizotugal.java
okie thx
is there a way to check if a mob is on my team btw
so libsdisguide did it
New code to try ```java
Location loc = chicken.getLocation().add(0,1,0);
BlockData blockData = Material.PLAYER_HEAD.createBlockData();
FallingBlock fb = loc.getWorld().spawnFallingBlock(loc, blockData);
Skull skullBlock = (Skull)fb;
skullBlock.setOwningPlayer(Bukkit.getPlayer("Nuxoria"));```
the wither didn't push me around
i wonder how they did it
frick their source code is soo
weird
hmm i did /scoreboard players list
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_16_R3.entity.CraftFallingBlock cannot be cast to org.bukkit.block.Skull
doh
where can I find the docs on the different packets
Been asking about my issue for a long time now, can someone please help me out here?
Yeah, I see no way to set the owner on a fallingBlock skull
as Skull is a tilestate
Are there really nobody here that is able to help me with my issue?
change public static void setup(){ to public ArenaConfig(){
then delete ArenaConfig.setup(); from your onEnable
delete ArenaConfig from teh start of line 11 in your onEnable
so its just reads arenaConfig = new ArenaConfig();
Can I ask how that's the issue?
static abuse for 1, for 2 you are creating a local variable for arenaConfig instead of assigning your field
for 3 you don;t need a setup() method and you can replace it with a proper constructor
Doesn't look like that was the issue at all
it was a part of it, show your corrected code
correct code?
your code with the changes
ArenaConfig: https://paste.md-5.net/itasosesad.cs
Main: https://paste.md-5.net/uwahotabah.java
This is the actual error when I try to use the arenaConfig constructor: https://paste.md-5.net/epihapijig.cs
ok, do you have a arena.yml in your data folder?
yes
ok, in your onEnable move the this.arenaConfig = new ArenaConfig(); to above the registerListeners
Now it shoudl work
show yoru PlayerJoin listener class
which is line 29?
int x = arenaConfig.getConfig().getConfigurationSection("lobbyLocation").getInt("x");
how are you instancing yoru listener?
pm.registerEvents(new PlayerJoinListener(this, this.arenaConfig), this);
your TIMV class doesn;t need to implement Listener, it already does, but it also has no Listeners in it
wdym it doesnt need to implement it?
JavaPlugin already implements Listener
You also have no Listners methods in your TIMV class so no need to pm.registerEvents(this, this);
the problem is still with the arenaconfig, not how that is handled?
Yes, I'm correcting mistakes so your code is understandable. you have a null config. Which means either the file has not been loaded or your passing around instances has an error somewhere. By fixing all these issues we'll narrow it down
ok, and you are 100% certain there is a file called arena.yml in your TIMV folder under plugins?
100%
I can access it and implement things so yes 100% sure
via the arenamanager I have
As your listeners are workgin I'm going to assume your EventManager implements Listener
yes
uhhhhh
so how do you add a library in a Java project that don't use maven or gradlw
like this?
paste your arena.yml
dude really? Lose the attitude. I'm going over your spider web code here. I would appreciate more manners.
I do appreciate what you're doing
learn to be respectful
we are using our time, we dont have to help if you are acting impolite
¯_(ツ)_/¯
bro I am? I'm jus tnot sure what is wrong with it
there are thre places that coudl be yoru null, arenaConfig, getConfig() or getConfigurationSection. The first two we have eliminated (probably)
instead of getConfigurationSection use getLocation
so Location loc = arenaConfig.getConfig().getLocation("lobbyLocation");
getLocation isnt an option for me
if that line works then you are fixed
1.12
😐
thats the one ima stick with
why is my gradle project no building, I click the hammer thingy
whats the error?
i used to just male plain java projects
no error
but the output
is not a jar
its like the same as src
it should be in the libs folder