#help-development
1 messages · Page 2279 of 1
Smh
:))))))
or its a 403 and you don't have the correct file permissions
nah
We assumed it was a regular-ish webserver
^
I really want to dissect the brain of people who show up on my support chatrooms, say they want free stuff because they're from X country where money isn't a thing, actually get free stuff and then tell people to go fuck themselves
Anyone who asks for free stuff because of XX is overly self entitled. Never give.
Do it while they are alive though, the brain may work differently when dead
I am not giving them anything special, I just have a lot of free content out there
and people don't read
one of these days I will go off the deep end and actually find a way to disable my plugin remotely on servers that just really annoyed me lol
hard to tell what server teh ass is on
Could be easy
unless you add a special key to any versions you give away
Just send them a rat
if I really wanted to it wouldn't be that hard to do, just make them open tickets with some persistent server id generated by the plugin
any way to remove all values from a scoreboard?
then host a blacklist somewhere the plugin reads and if the server is blacklisted don't initialize the plugin
Yeah
Annybody here a mongodb shard expert got a problem with a plugin that only work standalone.. seems to be a problem with SingleResultCallback
fetch teh blacklist when your plugin checks for any updates 😉
well who knows I've been doing this every day for 5 years now, maybe in 5 more years I will actually act on it
its better to not disable your plugin. Sabotage is better
that is against TOS and generally not something I'd want to do
Like the arkham devs made Batman spaze out when flying if the game was cracked.
So many posts complaining about it until they posted it was anti piracy
Just add a few "Bugs" and never fix them
boy things are getting heated, my AC is overheating again
System.exit(0) is the best
randomly 🙂
there's some fun anti-piracy things you can do that are fine with the TOS if you want to do a little trolling
tell us
sadness still get that same msg
message every non-op (or non-admin if you can be bothered to do a few permission checks) that a server is running pirated content if that is the case and then recommending them better servers to play on lol
lmao
see how long it takes before admins realize where that message is coming from
Strip all the signatures from chat messages to annoy players with that little warning icon
Anything it does should be quite random. Makes it near impossible to track down
maybe add come cool prefixes like [asshole]<username>: if they really managed to go out of their way to be a dick or [pirate]<username>: if they are running pirated content
but only do that every 10th boot
and only for 5 minutes at a time
is it against TOS to make it look like another plugin is doing things your plugin actually is lol
No clue
If it was me I'd just make it random enough to be near impossible to track down without removing plugins
after all the whole end goal is to get them to remove your plugin, but have some fun first
Fill ram 1 byte at a time
every 15 minutes fill the console with "errors" from a random plugin in their plugin list
SpigotMalware.jar has thrown a null pointer exception!
then you have users which ignore console errors ;/
Throw the error in chat 🙂
like people asking here i have a error in my console and its literally full of it
NSAWatchdog has thrown a CME!
once got a message from a user asking to help diagnose an error
it was a really weird error
couldn't figure it out
asked for the full log
170k lines of errors before mine
lol
async thread was fucked
if i'm trying to modify a FileConfiguration in a hashmap, do i have to re-put the FileConfiguration object back into the hashmap? or can i just modify it
um an FC in a hashman?
thanks
Holy shit
sometimes i question how i make shit work
so after signing a cert, you can just change the ip to the secondary one since the ip isnt tied
why does that feel so redneck
loop through the players inventory and if ItemStack.getType == Material.WOODEN_HOE do your thing
Is the if (inv.contains(Material.WOODEN_HOE)) check necessary or useless?
useless
is it safe to do file operations statically
not that if
if(inv.contains(Material.WODDEN_HOE) {
that will NEVER be true
oh
my typing from screenshots 🙂
wodden hoe lets goo
why?
an inventory will NEVER contain a Material
an inventory contains item stacks not materials
actually does it run correctly if you check against a entry of an enum thats non existent, or will it err out at compile/execution?
or is it just considered null
no i meant if you check for example a direction against BlockFace.FORWARDS which doesnt exist does it give an error or just return false
)))
keep it then 🙂
Tho that’s at most just a helper method
Wrong import probably
There are two Damageable
One for Entity and one for Meta
^
oh thx
this is the same annoyance as with shulkers again
be lucky you werent here when you had to add damage to coacoa beans to get lapis
or colored glass
lol yep, damage values for wool color
was annoying asf
i seriously wonder who thought of that, or if thats minecraft code and not spigot
either way i still wonder
I'm glad I took a break and didn't have to rewrite my code handling that.
i would of been pissed cause i would made a whole system for that
jesus finally
weirdest ptero install ive ever done
daemon is in ssl... doesnt like the ssl port so it needs http port
yet is communicating in ssl okay 😐
github smh
are
you
no your not
you cant be
theres no fucking way your pushing commits by dragging and dropping files into the github website...
pls
tell me your not
dunno how to do it via vscode lmao
Pro Tip: Don’t use VSCode für Java in the first place
grafana time
just looking at code
i found that the intellij github integration works well enough
lmao updated 50 dlls to github
hey guys ! i was developing my lifesteal plugin
so when i change the hearts of players on lifestael world they keep their amount of hearts on hub too i want it to reset hearts on hub world and set it back once joined lifesteal world
is there a plugin o store player data per world
?pdc store their Max health under a world key
Say I have a config file
test:
item1: 1
item2: 409358
item3: -2304230
What's the method to get all the items under test?
getConfigSection
^
getConfigurationSection I assume?
yes, then getValues
uh oh i found my first discord bot ever made
Fun times
its made in js 💀
I learned Python through making Discord bots so the code is horrific
That first bot was also my first time in Python
🐱
can i create a armor stand without spawning that?
not from the API
yes
hi do some one know if its poseble to move a intellij proj... to my new computer?
just copy the folder
what folder?
the project folder
but where?
the new computer ?
i have a new one now
Well then copy the folder from the old one onto the new one ?
hole folder?
Yes
and do i need to install plugin first?
if you want plugins then yes ?
you don't need any plugin but yea, if you wanna use that then install it 👀
cuz it will give you a plain new ij installation on ya new pc
what?
plugins
so i take the hole folder in to appdata and reinstall?
wat
you copy over the project folder
like your /home/blobsky/documents/ideaprojects/myawesomeproject
and just copy it somewhere onto your new computer
or just put in on gh 😏
Pen and paper is teh safest way to transfer
then you install intellij on the new PC like any other program and open that folder
i don't find the folder
Well if you cannot find your code then that is a rather unfortunate situation for you
send a vid pls
you are trolling right ? XD
If you want to transfer the project "CoolPlugin" from your old PC to the new one then copy the folder "CoolPlugin". Where you created that is completely up to you
but yea, that is the default I guess on windows ^
but in the program?
or just rightclick on a project open in explorer in intellij itslf
what java versjon do i need?
19

i hav 18 and it say openjdk-17 is missing
what java should i use if im coding a plugin for a 1.19 server?
ok ty
lol, that was a joke for someone else, but 17 is fine 🙂
oh my bad lol. so will the plugin work for all previous versions too?
no
well, yes and no
depends what version you build for
Mc/Spigot 1.19 requires java 17 (I think)
But if you set teh API version in your plugin.yml lower and set the compiler.source and target in your pom to lower, it can run
but you lose functionality
ok i will try to figure it out. im pretty new to java so i dont understand everything you're talking about, but thank you.
Build for the lowest version you want to target
hey guys do you know where is the problem plz ? I don't understand I get an IndexOutOfBoundsException: Index 1, Size: 1 with that code
i dont think you can write chatcolor just like that
like §b ?
ChatColor.translateAlternateColorCodes('&', "message");
i think it should be like that
no it works with just §
oh it does?
index starts at 0 so a length of 1 has one element at index 0
okay I think I see but How can I fix that
You are looping over your List using the index of your inventory size? Thats never going to work unless they are the exact same size
okay because I just want to check if inventory contains an itemstack who is contained in blacklist
for (Material item: list) {
if (inv.contains(item)) {```If your list is a List of Materials.
it's a list of items
change to ItemStacks else
okay thx so much I'm gonna try this
how can I break an elytra, or create a broken elytra
Correct. Set its damage to Material.ELYTRA.getMaxDurability()
are there any ways to check if a block is a wall torch-able
um, if its already a block then its already a wall torch. Do you mean ItemStack?
You mean if you can place a torch on the side?
yeah
attached at the block
since torch and wall torch are different from each other
wall torch is directional
is there a specific tag for checking this
I'm not doing the attaching manually but through raytracing
when the raytrace result hits a block i gotta check
I would go the easy route and just check for isSolid()
aight, thanks
or get the material and see if it has WALL_TORCH in its name
choco added API for this like a few days ago no ?
the stairs are an example here
declaration: package: org.bukkit.block.data, interface: BlockData
That would also apply for ladders
who wanna make a- srv
I'do an isSolid check first, I'm currently supporting older spigot versions
I could do cross version checks if isSolid check aint enough
since lynx mentioned a new api for it
My friend, I did just add those methods to 1.19 
Oh Lynx beat me to it
Update your server if you haven't already but yeah those are the methods you want
Oop, in that case, yeah, isSolid()
Currently the plugin supports 1.15-1.19.x
Nothing else you can do
It was the whole reason I added those methods. I needed them for a plugin I was writing lol
once most servers are out from those older versions, I'd ditch supporting older versions
I mean 👀
Are you tracking this yourself with Metrics? Because as far as I'm concerned, 1.18 is the most used version
At least with my userbase
bstats
https://bstats.org/plugin/bukkit/FNAmplifications/13219
so far no more 1.15 according to the metrics
Yeah, bigger concerns for you are those 1.18 versions which still consist of about 45% of your userbase
The other 17% or so on 1.17 and 1.16 are marginal and could be dropped. Remember that server owners can still use older versions of your plugin
They lose out on features, but they do that anyways by running an older version of Minecraft
will take a look at it soon, since I never really like supporting older versions for numerous reasons
I like to hear that lol
but ye, for 1.19, those methods will be super handy. I specifically added them for torches and amethyst buds
for that I appreciate you, cheers
o/
darkreader hates teh bstats website 😦
I have teh choice of blinding white, or unreadable
hi back ! do you know if it's possible to check if an item is cooking
hello back
im dad
You mean in a furnace?
yes
^
thx a lot !
Is it better to use a infinity while or a runnable in java net?
?scheduling
in java.net ?
I mean, a runnable just runs things once
not really the same as a while(true) loop
I mean to scheduel
is there a way to make leather armor have the same durability as netherite?
while true on the main thread will not like that
Yes it crashes the server
i mean while true is synchronized on the device hardware, the scheduler methods on the tps
I thought these aint full solid blocks
why does it always looks ass
Only synthetically by cancelling the damage on the armor for a percent chance so that the effective durability matches
Idk what you mean. This looks good.
I would def add brackets to your safeguard statements but other than that i looks fine
btw is calling event.setstuff safe on the cf threadpool?
A block is solid if it collides with a player, basically
Some of its faces aren't sturdy, but the block is solid
aight, just a bad assumption from me
By default no
tbqh with you, I would just ignore stairs and slabs entirely if that's an option
uh oh smells like problems
You’d have to join the thread that’s running the mutation statement in the event listener callback
Oh i see, but that seems like a not effective solution, anything other than this solution?
same with fences and other stuffs xD
well im joining on the end, is that also good?
yeah tedious but doable
When you set something in an event from a different thread then the event might be over already and your actions have no effect.
Joining mitigates this obvsly
I'd just check on some other tags for it
Right
This was my recent implementation (because we were still writing against 1.18.2),
private static final Set<Material> IGNORED_SOLID_BLOCKS = new HashSet<>();
static {
IGNORED_SOLID_BLOCKS.addAll(Tag.SLABS.getValues());
IGNORED_SOLID_BLOCKS.addAll(Tag.STAIRS.getValues());
IGNORED_SOLID_BLOCKS.add(Material.AMETHYST_CLUSTER);
IGNORED_SOLID_BLOCKS.add(Material.SMALL_AMETHYST_BUD);
IGNORED_SOLID_BLOCKS.add(Material.MEDIUM_AMETHYST_BUD);
IGNORED_SOLID_BLOCKS.add(Material.LARGE_AMETHYST_BUD);
}
Which sucks, but I had no choice lol
so in my case it should be fine right? (as im calling cf::join on the end?)
You predict the future too much
thanks
Yes
ah good good
(I ignored buds and clusters there specifically because I was placing buds next to buds, so they'd stick to one another lol)
But joining isn’t exactly the cheapest thing to do, but if you really need then do it
hmm i was always wondering if that join method worked like the toList method on a stream
Ugh what
so the whole thing is a chained method but the stuff iis only executed when you call toList or smth
Any reason why they are in set, are the order important there
Order isn't important (hence the Set) and its contains operation is faster than a List
Ig you could draw a distant parallel brush
EnumSet would be ideal but there are efforts to make Material not an enum anymore
Up to you
oh for most of the time I thought list was faster, I'm badly doomed
and what kind of animal is a distant parallel?
tbh the Material enum is large enough to where an EnumSet's benefits aren't even applicable
HashSet is fine
fair, I'd do hashset
Good question, I meant to say Ig but auto correct shot me in my feet
ah yes 🤔
But iirc toList just uses collect internally
MD specifically said not to use EnumSet any more
Ye
Which is just a glorified binary operation
uhhm ye wtf
yeah since they are constants but the difference is negligible, hashset it is. thanks
Hey guys im trying include full spigot server(with nms) into my project classpath using gradle. I followed this https://www.spigotmc.org/wiki/spigot-gradle/#build-gradle-kts. But some libraries can not be find(com.mojang:authlib:3.5.41 com.mojang:datafixerupper:5.0.28 and com.mojang:logging:1.0.0). How can i fix this problem
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
joining a CF would just make current thread await the computation for the thread that’s running the computation
Unless interruption or sth yk
yes
i dont want to write two separate methods to load a user sync and async :/ as i need both
and those methods should be specified in the database interface
I usually have an async view, and a sync view
Whenever I am facading something like IO related
This is my repositories
But yeah
hmm well actually i could write two methods
as im not interacting with the Database but the DatabaseWrapper
brr
Well, main issue is that CF::join would imply that you in principle use concurrency when it’s not needed
so then, just running the computation as is might reduce some footprint
Are you loading data on join or something?
yes
AsyncPlayerLoadEvent
Is that a thing?
PreLogin*, sorry
thats why am blocking the async thread kekw
Ah ye
.
Do synchronous computations there because the event is async
youre late
o
I whish there was an async event that was fired a bit later because of bungeecord.
The AsyncPlayerPreLoginEvent is fired even before the PlayerQuitEvent is fired on the initial server.
This means persisting data into a DB before the player connects to the other server is quite the hustle.
Ye that makes sense
kekw
We addressed this by using some lock extension available on redis, agree tho it’s a bit of a pain would rather skip the locking
Same. Redisson locks carried this one.
🥲
But there is still a short timeframe where data could be lost.
Myeah it’s far from ideal, just sitting here and praying everything is going as it should
basically me everyday
hmm so this would be the sync way
well both are sync but i mean without the cf
oh thats smth too
btw does it make a difference to print a stacktrace before doing like recovery stuff in a catch block or doesnt it matter?
Recovery stuff?
it would be good to know what the error was else there could be a huge number of causes
uhh like stuff you would do in a catch block
ever tried debugging a users issues with no stack trace? 😦
uh well actually i was asking if i should print the stacktrace before doing other stuff in a catch block?
Doesn’t matter
At least print the stack trace
In my plugin I cancel the EntityShootBow event. To the player, it seems that it still takes away an arrow, even tho the event has been cancelled. If the player clicks on the shot of the arrows, they will go back to the original amount. Is there a way I can make it so the player doesn't see their arrows disappear?
ye i forgot
registered it?
Try calling an inventory update one tick later. Btw what version?
declaration: package: org.bukkit.entity, interface: Player
1.8.8 😬
What do you mean by registered it?
Well the try updating to a non-ancient version first
Well, it's a plugin made for a 1.8 style pvp.
Is there no other way to go around it?
hmm i was also thinking about how to bind a player instance to a KingdomsPlayer (my class), lemme show some code
https://github.com/FourteenBrush/xKingdoms/blob/master/src/main/java/me/fourteendoggo/xkingdoms/listeners/PlayerListener.java
like its loading a player on the async pre login and then putting the retrieved kingdomsplayer object into the cache, in the join event, it simply gets it from cache and calls KingdomsPlayer#login(player) to bind a player object to it (for some internal stuff)
maybe i could just use Bukkit.getPlayer(uuid) too but i believe there is a cleaner way
https://github.com/FourteenBrush/xKingdoms/blob/de32143f643f1cb078dc4d5bb8e17d189808cb14/src/main/java/me/fourteendoggo/xkingdoms/player/KingdomPlayer.java#L28
Ok so imagine i have a list of a million strings, and then a value for each string. What is the most overengineered way of getting the value of a specific one
😳
have a seperate getter method for each string
ez
A hashmap?
This is cause its for a school project and i get marks for implementing things
i mean yeah that would work but ^
Write your own hashmap class?
school moment
this is the quote on quote "mark scheme"
A million strings would be gigabytes of ram in a hashmap
and that^
Oh wait nvm, updateInventory() also exists in 1.8 ^
So much crazy you could do...
A CompleteableFuture which pushes a String to a Queue. A Thread waiting on that queue pulls the key and fetches the value using a regex match of the key.
Add in any other crap to make it really stupid.
Tree traversal means not just pulling a key/value. That means searching yourself
i dont really see how i can represent it as a tree though thats the main issue
neither do I
can someone help me
?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. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
You could bubble sort on the key hash
oh my god that would take an age no?
yes
I have a server and i had to disable every chest in the world because when i downloaded map there is TONS of chest with items i dont use within the play style of the server i want to link every single one to phatloot but it would takes weeks on weeks because theres over 7000 chest. how can i do it instantly
fucking merge sort it when i ingest it
also i cannot install new plugins to my server because when i install plugins it for some reason breaks all permissions, nobody can /warp or anything after ive installed a new plugin
This sounds like a #help-server question
Avoid mutability unless you have compellingly strong reasons to design around it
@eternal oxide what about if i split the key into sections and then use a tree
Ie the first 5 chars form one node
and then that groups to all the next five
I suppose i could sort them all by a comparator like that
although that still requires them to be loaded in memory
public Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);
Default constructor cannot handle exception type IOException thrown by implicit super constructor. Must define an explicit constructor
bungeecord
fixed it
public Configuration config;
@Override
public void onEnable() {
try {
config = ConfigurationProvider.getProvider(YamlConfiguration.class).load(data);
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
like this
that's bungee
oh right a character tree
Hello guys ! Someone know why when i get CreatureSpawner, I edit value likeCreatureSpawner blockSpawner = (CreatureSpawner) clickedBlockState; blockSpawner.setMinSpawnDelay(10); blockSpawner.setMinSpawnDelay(20);but when i check with command /data get values was not changed
clickedBlockState.update()
or blockSpawner.update()
you are working from a BlockState, you must update() to push teh changes back into the world
Ok but when i : blockSpawner.setMinSpawnDelay(10); blockSpawner.setMinSpawnDelay(20); blockSpawner.update(); that not working
is it recommended to save config file async when running the server? i mean like big config files like the one from essentials?
i have https://pastebin.com/VLdkTyDw which gets all blocks between 2 locations, but if given 2 locations how can i get each row of between the 2 locations? sort of hard to explain but if i made a cube y 1 -> y 6 how can i get the rows from y1 -> y6
In that case you can;t be working on an in world BlockState
So how can i fix that ?
how did you get teh BlockState?
teh ?
the?
if (clickedBlock.getType().equals(Material.SPAWNER)) {
BlockState clickedBlockState = clickedBlock.getState();
CreatureSpawner blockSpawner = (CreatureSpawner) clickedBlockState;
blockSpawner.setMinSpawnDelay(10);
blockSpawner.setMinSpawnDelay(20);
blockSpawner.update(true);
player.sendMessage("Modif");
}
}``` Yes i did
However, max of 20 and min of 10, thats a super fast spawn
That a test values
those are in ticks
With command /data get
Is there a way to get the Saturation an Item provides when consumed?
so you click the spawner to set values, then use a command to check them?
I apply test value with right click and i check if values changes with command /data
So long as you are actually testing the same block, and its not in the same tick as you set the values, I see no issue
Your code looks fine
Maybe 1.19 problem ?
I will
Paper does some weird stuff with spawning (I believe)
Okay so I wanna create mobs that are hard to defeat but base them off of the biome that they spawn in. So if a Zombie spawns in a Jungle it's difficulty would be level 15, and it would have more health and damage. How can I get where the mob has spawned? Can I get the spawn biome of where it spawned? I don't want to change the mobs attribute whene they are in the biome only when they spawn in it.
thank you
This says it's for blocks?
Entity#getLocation().getBlock().getBiome()
listen to the spawn event
and modify the Mob as required
Ah alright.. I understand it now
Is there a way to get the Saturation an Item provides when consumed? Or do I still need to use NMS do do this?
i'm trying to send a respawn packet to the player (just to make the client think it has to fetch the skin again), so it shouldn't affect his position at all, nor his yaw pitch, etc
ClientboundRespawnPacket
(
ResourceKey<DimensionType> dimensionType,
ResourceKey<Level> dimension,
long sha256Seed,
GameType gameMode,
GameType previousGameMode,
boolean debugWorld,
boolean flatWorld,
boolean keepPlayerAttributes,
Optional<GlobalPos> lastDeathPos
)
i struggle getting the first 3
maybe this might help, i think you'll need nms yes
https://bukkit.org/threads/get-nutrition-values-of-food.186559/
how i can manipulate entity nbt?
but the FoodLevelChange event has a getFoodLevel method, dunno if thats what youre lookin for
I'm fairly certain thats nto going to work as the client will still have the player info
Hey guys, question for you. I have an existing custom item that uses the ender pearl as a base item for people who don't have the texture pack. However, since I am using Material.ENDER_EYE as the base, it comes with some caveats. If I want to support enchantments (mending for example), I need to use a tool or a something as a base that supports mending. I think I have a way around this, but I want to be sure there isn't an easier way first.
I was thinking about listening to the InventoryMoveItemEvent for when the custom item is placed into the enchanting table, then replacing the item itself with an item that supports the enchants I want (skinned to match the normal custom item for continuity), then listening to the EnchantItemEvent and replacing the result with the original custom item + the enchantments that were on the mock item.
Its possible this whole process is crazy convoluted so I was wondering if anybody knew a simpler way, thanks in advance!
You probably need to send a ClientboundPlayerInfoPacket for ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER and again for ClientboundPlayerInfoPacket.Action.ADD_PLAYER
Thats a way to do it, but it's prone to breaking if they ever makes Changes to those Values
Thx paper rofl
Ok so it's not Paper
I just noticed in yrou code you set teh Min delay twice
first to 10, second to 20
Bruhhh
XD
Thx c/p
what do yall think about saving player inventory to file all the time instead of on server stop
i personally think its safer
lets say server crashes right
what do yall think about not using plugins that make the whole server crash
which one does that
well why would you do that if nothing is going to crash
no look
lets say
server crashes somehow
not by plugin
there are disasters, other plugins, lag etc
i dont think few kb of files being managed every x seconds is a lot
to be fair, I haven't tested. But according to what i'm seeing online, this wouldn't be sufficient; updating someone's skin happens in multiple steps: (at least for older version)
- sending info packet "removing player" to everyone
- update their gameprofile with new textures
- sending info packet "adding player" to everyone
- refreshing the player for self (that is "telling all the client to retrieve the information of the player again") and a way to do that is respawning the player
Here's how they did it (but that's old code, those fields don't exist anymore)
PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(ep.getWorld().getDimensionManager(), ep.getWorld().getDimensionKey(), ((long)player.getWorld().getSeed()),
ep.d.getGameMode(), ep.d.getGameMode(), false, false, true);```
5) refreshing the player for the other players
**Ressource (but for <= 1.17):** https://www.spigotmc.org/threads/refreshing-the-player-applying-skin-texture-example-used.525091/
**Some already given inputs (but <= 1.17):** https://www.spigotmc.org/threads/refreshing-the-player-applying-skin-texture-example-used.525091/
well idk if players inventory is saved every x time but if it isnt you might want to do it yourself i guess
its not terrible by any stretch of the imagination...
Around 1.2 seconds to parse 1million entries
and cause of the maps, near instant lookup
net.minecraft.network.protocol.game.ClientboundRespawnPacket.class
guys do you know if it's possible to get the floor type (block type) at the PlayerDropItemEvent ?
getItem().getType()?
not this the type of the block at the floor who get the dropped item
this?
so the player who pickup the item?
not really I would like to send message if the floor is a block of stone and if the item is dropped on the floor
so you need the location where the item lands?
so I throw the item on the floor and if the floortype is stone we send message
yes I need the location of the item at the floor
the drop is an entity and so has a getLocation
dunno if thats the correct location too
How do I check if a block is a mob-spawner is a 1.8.8 - 1.19 compatible way? Currently doing if(loc.getBlock().getType().getId() == 52)
Material.SPAWNER && Material.LEGACY_MOB_SPAWNER both aren't working on 1.8.
yes because when I use event.getDropItem.getLocation this is the location when I throw
entity is the Thrower ?
#externalclass1
public boolean onCommand(CommandSender sender, Command command, String label , String[] args){
if(command.getName().equalsIgnoreCase("vanish")){
if(sender instanceof Player){
Player p = (Player) sender;
if(p.hasPermission("evanishplus.vanish")){
if(plugin.invisible_list.contains(p)){
for (Player people : Bukkit.getOnlinePlayers()){
people.hidePlayer(plugin, p);
}
plugin.invisible_list.remove(p);
p.sendMessage("you r now vanished");
}else if(!plugin.invisible_list.contains(p)){
for (Player people : Bukkit.getOnlinePlayers()){
people.showPlayer(plugin, p);
}
plugin.invisible_list.add(p);
p.sendMessage("you r no more vanished");
}
}
}else{
System.out.println("Wrong executor for this command, please enter the server!" );
}
}
#external class2
@EventHandler
public void onJoin(PlayerJoinEvent e){
Player p = e.getPlayer();
for (int i = 0; i < plugin.invisible_list.size(); i++){
p.hidePlayer(plugin, plugin.invisible_list.get(i));
}
}
}
#mainclass
public ArrayList<Player> invisible_list = new ArrayList<>();
hello, above i have put everything I use for a vanish command, external class2 is supposed to hide all vanished players from a player who just joined the server, because otherwise he can still see a vanished player unless he was on the server while the player typed the vanish command
However the external classes 2 job doesnt seem to be done, how can i fix that?
me?
no
oh ok
okay
what are these hashtags
stuff he added
I have 10 doors (figuratively) and 1 is the same. what can I then do with it in order to understand in the code this is that door?
wha
What ? 😂
when I track a click on a block in the plugin, I need to understand that a person clicked on this door, for example
And define how you need to differentiate this door 😂
That's exactly how?
i know
Hey, I would like to get the block that the player is standing on. I use player#getLocation()#getRelative(BlockFace.DOWN);
The problem is that on slabs; stairs etc... (non full height blocks) i get the blocks under the slab, stairs etc instead of the good one. Any idea how to fix?
I tried to calculate with block height but seems like there is no way to get blocks height
Well we need to know : is it a relative location ? Is it a door you defined ? .... ?
door
Get player location, substract 1 to y, get the block
Ohh you want the slab
its coordinates are not static
I want the block the player is standing on
Then substract 0.4 and I guess it will work
YES THANK YOU. But you have 10 doors, how do you know WHICH ONE is the good one?
I ASKED THIS
what to do with the door, then to understand what it is in the event
Doesn't work either.
[16:54:55 ERROR]: Error occurred while enabling DeepSMP_plugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "[Ljava.lang.String;.clone()" because "this.rows" is null
at org.bukkit.inventory.ShapedRecipe.getShape(ShapedRecipe.java:195) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe.fromBukkitRecipe(CraftShapedRecipe.java:32) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.addRecipe(CraftServer.java:1389) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.addRecipe(Bukkit.java:971) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmp_plugin.deepsmp_plugin.Main.onEnable(Main.java:118) ~[DeepSMP_plugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1018) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
i know
?paste
We can't help you LMAO, you have to choose how to differentiate this door : maybe you can save it's location, or maybe count it relatively. When you'd successful choose how to differentiate this door from other doors, we can tell you how to do
put a block under the door and then check which block is in the code
Its sad that there is no created method to get the exact block the player is standing on
I think the only way is to get the actual block height but there is no such method
Hey! I'm trying to prevent users to put items into specific slots, and it works. Unless the player clicks really fast. Is there a specific reason for that?
Then do a if statement: if the player location modulo (int) location is > 0.2, get the current block at the location. Else get the block under (if it's air, get the block under the under block)
Then in PlayerInteractEvent, if the clicked block is a door, get the block under it, and check if type is smth
https://paste.md-5.net/azokihaqeq.java there's a prob with my code can someone help ?
[16:54:55 ERROR]: Error occurred while enabling DeepSMP_plugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "[Ljava.lang.String;.clone()" because "this.rows" is null
at org.bukkit.inventory.ShapedRecipe.getShape(ShapedRecipe.java:195) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftShapedRecipe.fromBukkitRecipe(CraftShapedRecipe.java:32) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.addRecipe(CraftServer.java:1389) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.addRecipe(Bukkit.java:971) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmp_plugin.deepsmp_plugin.Main.onEnable(Main.java:118) ~[DeepSMP_plugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:563) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:477) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.reload(CraftServer.java:1018) ~[paper-1.19.jar:git-Paper-58]
at org.bukkit.Bukkit.reload(Bukkit.java:909) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
Sir, this is Spigot
Client is not synced with server I guess, so the client see it worked but in the server it's not in the same location
uh yes no i mean no
So basically there's no actual way to fix this
What's on line 118 ?
wait lemme see
Don't think so I'm sorry
How to make a safe and fast teleport to a random position?
Bukkit.addRecipe(Recipe3);
is there a door open/close event
do i delete it ?
for players and villagers
me ?
Yea
mb
just to keep the player from getting stuck in the walls.
oh wait
you are shaping recipe
not recipe3
which leads to a shapeless shaped recipe
which errors
the code too long
hm ?
or change it
ShapedRecipe recipe3 = new ShapedRecipe(new NamespacedKey(this, "FINAL_SWORD"), FinalSword);
recipe.shape(" ","SC "," ");
recipe.setIngredient('S', new RecipeChoice.ExactChoice(DarknessSword));
recipe.setIngredient('C', new RecipeChoice.ExactChoice(CustomIngot));
like, you want to recipe3.shape(bla bla bla)
and so on
OH
you are using the wrong variable
bump
?jd-s
is loot table used for zombie/entity drops?
this is called from opening a door?
i also can't really get the player who opened the door with this event (if a player did open it)
huh
Maybe I didn't understand well but it isn't working on slabs.
Location to = event.getFrom().getBlock().getZ() % (int)event.getTo().getBlock().getZ() > 0.2
? event.getTo().getBlock().getLocation()
: event.getTo().getBlock().getRelative(BlockFace.DOWN).getLocation();
It's almost that but with Y not Z ;)
oh yeah mb
im trying to do a countdown on a scoreboard. What is the best most efficient way to update the lines without flickering?
so im wanting to make a reload command for my plugin and for some reason this isn't working
if (cmd.getName().equalsIgnoreCase("pcreload")) {
config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
sender.sendMessage(ChatColor.YELLOW + "PokeClear has been reloaded");
}
return true;
}```
any errors?
it just says command doesn't exist when I run it as a player, but no errors in intellij
oh
and when i do it through console it doesn't work either
Did you remember to register the command in your plugin.yml?
Works well thanks
ye this is what I have
pcreload:
usage: /pcreload
description: reloads config.yml for PokeClear!```
or would i do this
pcreload:
usage: /<command>
description: reloads config.yml for PokeClear!
this is what my config looks like:
commands:
gstart:
description: "Starts the game"
usage: "/gstart"
aliases: "startgame"
so
I think the things needs to be in quotes
and commands is lowercase
the aliases might also be necessary
pcreload:
usage: "/pcreload"
description: "reloads config.yml for PokeClear!"
aliases: "pokeclear"```
?
you need to lowercase the Commands
ok got it lemme see if this works rq also would I be able run it as a player?
or only through console like that
if (cmd.getName().equalsIgnoreCase("pcreload")) {
config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
sender.sendMessage(ChatColor.YELLOW + "PokeClear has been reloaded");
}
return true;
}```
you should be able to run it as a player
if you have remembered to set the executor
it still doesn't send the reload message
registered it?
I did I registered the command
Awesome! (Wasn't sure at all 😂)
[Thu 17:24:46 INFO BuycraftX] Fetched due players (0 found).
[Thu 17:25:08 INFO Minecraft/ServerPlayNetHandler] JohnShiesty issued server command: /pcreload```
ye it just says this in console
i dunno either lol
do a sysout to see if you code actually has been called
if (cmd.getName().equalsIgnoreCase("pcreload")) {
config = YamlConfiguration.loadConfiguration(PokeClearPlugin);
System.out.println("config loaded");
}
just that?
uh and put your send message there to see if it gets printed
anyways how does this look? https://paste.md-5.net/muxifeyara.java
use lombok
I’ll send you money if you use it
what attribute gives skeletons more damage? GENERIC ATTACK DAMAGE does nothing as they are a bow...
how much
how much do you want
hey !
while putting my plugin on a server, i get this error :
[17:33:26 ERROR]: Could not load 'plugins/NarutoNew-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/sk89q/worldedit/MaxChangedBlocksException
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [server.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [server.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_312]
Caused by: java.lang.NoClassDefFoundError: com/sk89q/worldedit/MaxChangedBlocksException
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_312]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_312]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-21fe707-741a1bd]
... 6 more
Caused by: java.lang.ClassNotFoundException: com.sk89q.worldedit.MaxChangedBlocksException
at java.net.URLClassLoader.findClass(URLClassLoader.java:387) ~[?:1.8.0_312]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[server.jar:git-Spigot-21fe707-741a1bd]
at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ~[?:1.8.0_312]
at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_312]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_312]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_312]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[server.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-21fe707-741a1bd]
... 6 more
Idk what to show u, if anyone knows why tel lme !
thats my main class
https://paste.md-5.net/egopoqaqix.java anyone know why the reload command not working?
Is there an error?
no
you still need to set the executor
getCommand(“pcreload”).setExecutor(new CommandPCReload(this), this);
to register it
anyone has any idea?
Someone have any idea how I can allow another plugin to spawn a mob in an unloaded chunk? The plugin itself is already calling Chunk#load, I tried setting Entity#setRemoveWhenFarAway to false in EntitySpawnEvent, but the spawn method still returns null when in an unloaded chunk
is there something more accurate than player#getTargetBlockExact?
do you have worldedit on your server?
If i try right clicking the very top right portion of a door, it returns null
so im like super super new and don't know all the basics of java how would I set the command executor?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
nope i have the api for my plugin
you need world edit 🤦♂️
you cant add a dependency as a provided state and expect it to work without any classes provided
wait how was i able to replace lets say all "Bukkit.broadcastMessage" with "players.sendMessage"?
intellij btw
what?
bump
Player#getTargetBlockExact is pretty inaccurate, when I try right clicking here, it thinks that I'm right clicking air
and therefore it bypasses all my lock checks and the player can open the door
(for Player m: Bukkit.getOnlineMembers()){
m.sendMessage("sdsdsjds);
}
smth like that
is there an alternative
no but in intellij itself there was a shortcut
do u have copilot
that replaces all text that matches something
ctrl + f
oh now i understand what you mean
how i can read nbt of entity?
people dont seem to care about naming conventions lol
you didnt register the command
how can i use "Expansion-ChangeOutput" to substract 1 from any value, like %server_online%
so how i can get array of firework stars from firework? (FireworksItem.tag.Fireworks.Explosions tag)
or how to substract a number from a placeholder using another way, not using expansion-changeoutput exactly
?paste
get the firework meta from the firework
and then iterate over its effects
oh thanks
e.g.
final FireworkMeta fireworkMeta = firework.getFireworkMeta();
for (final FireworkEffect effect : fireworkMeta.getEffects()) {
final FireworkEffect.Type type = effect.getType();
final List<Color> colors = effect.getColors();
final List<Color> fadeColors = effect.getFadeColors();
}
Who tagged me?
search it up
Why finals, looks like a deobfuscator
What that?
I like finals
But finals i dont see them often on methods
I see then more as fields modifiers
die
How are you doing the format part?
Because want to do something similar but with key-value
just wrote this
Something like:
public void sendMessage(String path, String... replacements) {
}
check out ma code
Allright thaks bro
its not perfect but im working on it
Allright but allow to replace key-value from the path?
yes
@eternal night you got a sec? need an opinion
how to create Component object with hex colored text?
ChatColor.of from the md blablabla package
bump
use the playerinteract event to get the clicked block
thats what im doing
the event doesn't have the right clicked block
i dont see much lol
oh nvm wtf
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
ChatColor.of("#a88b32") + "A B C"
You are passing a string not a text component
?jd-s
WOW REALLY?
since when does the displayname needds to be a component?
ye
Hey guys, I notice when I cancel a PlayerInteractEvent with a placeable block in hand, the block appears for a split second before disappearing. Is there a way to stop this behavior, or is that just always gonna be the case?
you cannot. the client predicts the block being placed
the server updates the client as fast as possible
but yeeaa
I have a very large data set of hashes, i need to parse them all somehow. They are 40 long and all have a value.
At the moment i have this tree thing set up:
https://paste.ollieee.xyz/okigopuxic.csharp
Where it sets up nodes of substrings of length 5.
It works well for a couple million but eats memory cause of the pure amount of hashmaps.
Have you got a better way of doing this you can think of. Its important i mention that this is for comp sci work and the reason it is overly-complicated is cause i would get more marks lol
Its not a huge deal, just a little extra touch that would be nice =] but its fine that it appears for a second
ty lynx
the addChild thing is wrong on this - but you get the idea
lol xD so just to make sure I understand it, you have a giant collection of hashes and your goal is to index them as efficient as possible both space and time complexity wise
yeye, the dataset is just a huge .txt in the format hash:value where value is int
the tree i find really cool, but the hashmaps are eating my ram :p
ingesting about 2m values is about 5GB of ram
so its not tooo bad, but its more than id like
Yea I see, you do go to 5 buckets initial capacity. I presume you are preventing over allocation in the actual addChild method ye ?
er. no
I mean just to grasp the concept of your tree.
didnt think it really mattered
you split each hash into 5 char long subsets
guys how do i get rid of the decimal?
Yo im receiving the error in the attachment with the code:
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));```Yo im receiving the error in the attachment with the code:
```java
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));```
and basically grab the first 5 char long subset, throw at the first node and see which subnode that hash belongs to
well thats a plot twist i actually thought its c# tbh xD
who said i wrote that
youre still programming it
true
I think that's a placeholder js for papi or something.
something like this, where if you followed all left paths, it would have a hash of 9SXVC5D35F3FGDS
Yea
it is
have you checked what your actual coverage with that is ?
like,
how often you can reuse a bucket
idk what hashing function you used but I would think this tree becomes horribly wide
oh yea i imagine
its SHA-1
thats what this DEFAULT_WIDTH thing is, i was messing with it earlier
The reuse is fairly high for the first map, but drops to 0 basically immediately
well, its about 3
but anyway, an intiial capacity of 5 won't help you there
the hashmap just grows
java doesn't lock it at 5 buckets and then just does conflict resolution from there on
so what - nerf the 5 all together and just let it do its thing?
wonder if i could reuse a bucket. have some sort of pointer system
if we have already had a certain sequence before
I mean, the 5 isn't the issue here. you are just going horribly wide which creates presumably giant hashmaps on level 0 and 1 of the tree
So I have created a plugin I am using to amplify a SMP server for my friends and I. I wanted to get all the basic essentials down like Config setup, Simple Listeners, Economy & Database Integration. I decided to go with the already integrated JDBC with my remote setup.
I am having some issues where my plugin only works for about a minute after I have reloaded the server or restarted it. The code will run fine for about a minute or two, but then will stop working and I get errors.
Here is the error code: https://pastebin.com/YsZJaQHR
If anyone could tell me what I am really doing wrong, or assist me in the right direction, that would be much appreciated it.
Code for entire plugin: https://github.com/projectbrady/NewLife/tree/master/src/main/java/me/projectbrady/newlife
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
level 0 is 600k keys in the map
actually reusing could get difficult
two different hashes could end at the same point
yeah
Yea sha1
??
uppercase and numbers only
Would be interesting to see how far your get with a sorted array when you just interpret the substrings as longs
Insert would be horrible
But I presume that isn't the goal here
is there any way i can shut players the fuck up from writing minecraft:me?
does this for anyone wondering
how do you mean sorted array?
Like, sorted long array that you can traverse like a binary tree
that would be a very long array lol
I might try it later 😜 am cooking now tho
I mean, array might be nicer than a lot of buckets with arrays inside XD
Actually how does java hashmap resolve collision
What's the strategy ?
I don't recall it
not sure
Hey guys, does anyone know how I can spawn entities in a unloaded chunk?
load it?
I tried Chunk#load and Entity#setRemoveWhenFarAway, didn't work
Is there any way I can get the locations of every block of a certain type in a chunk, without scanning to entire chunk. Like is there any already existing methods
Also tried
no you must loop
World#spawnEntity still returns an entity which returns false for #isValid
Alright. That's what I'm doing right now, but just thinking it might get too intensive when I need to start doing it to alot of chunks.
what type of block?
Any. Like configurably .
Things like Chests is easy. normal Blocks, not so easy
This looks like essentialsx
for(slocation : getAllChunks())
{
for(int i = 0; i <= 15; i++) {
for(int j = 0; j <= 15; j++) {
for(int k = 0; k <= 254; k++) {
if(slocation.getChunk().getBlock(i, j, k).getWorldLocation.getBlock().getType() == Material.DIAMOND_BLOCK)
{
// diamond block found
}
}
}
}
}``` this is what I'm doing right now basically. But when I need to start doing this to a few thousand chunks I think performance will not be great =p
Scanning 10 chunks is like ~40ms currently, which isn't terrible
you should make a chunk snapshot per chunk
and then have a bunch of worker threads parsing all the data
disable it using a permissions plugin
or make your own permision handler
figured
is there an FillEvent for glass_bottle??
PlayerInteractEvent
no
p.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("vanish-success").replace('%player%', p.getDisplayName())));
help?
no errors for me
wdym
I know, Im using the same frickin code for my other plugins and it seems to work correctly
thanks!
if(event.getAction == ACTION.RIGHT_CLICK_GLASS_BOTTLE){
//your code here
}
}```
smth like that
@frozen cedar
i made a plugin for that
give me the plugin daddy
imajin plugins 🤮
Ok
Try it
I dont know if it works on minecraft commands
review "works like a sharm"
idek what that means
prolly mistyped for charm
what?
RIGHT_CLICK_GLASS_BOTTLE doesn't exists
i said smth like that i forgor the exact thing
The entity does spawn but it somehow still returns false for isValid
i ended up with this random nonsense, i give up lmao
I dont know that is what appear on his picture as required type
@tardy delta
is armor contents sorted so that first is boots, second leggings, and so on?
I think they are in order
From top to botton
alright
paper api
You can use the deprecated method, setDisplayName.
okay so you can check for RIGHT_CLICK_BLOCK and if the block is water check if the player is holding GLASS_BOTTLE
the block on which the player presses to draw water is not WATER
this is the block that is behind the water
you could check the location above the block
Try Player#getTargetBlockExact
i check getClickedBlock
// check if they right clicked and
// if they used an item
if (event.getAction() != Action.RIGHT_CLICK_BLOCK &&
event.getAction() != Action.RIGHT_CLICK_AIR && event.getItem() != null)
return;
// check if they used a glass bottle
if (event.getItem().getType() != Material.GLASS_BOTTLE)
return;
// get real targeted block
Block firstIntersectingBlock = player.getTargetBlockExact(
/* max reach */ 3,
/* only accept fluid source */ FluidCollisionMode.SOURCE_ONLY
);
// check if it is a water source
if (firstIntersectingBlock.getType() == Material.WATER) {
// they filled a bottle
}
yes do String x = getClickedBlock.getLocation.getBlockX();
String y = getClickedBlock.getLocation.getBlockY();
String z = getClickedBlock.getLocation.getBlockZ();
and with that now increase the y and check if the location is water
