#help-development
1 messages · Page 139 of 1
well test it and find out
yo
How much is it supposed to increment it by?
Does HandlerList.unregisterAll(gameListener); unregister every event handler that was registered using Bukkit.getPluginManager().registerEvents(gameListener, this); ?
cuz it doesnt seem to work
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/event/HandlerList.java#83-89 there is nothing to not work ig
Ok nvm, it works, my bad, ty
Is there any way to make this work?
All variables are set to something*
if ( usage.equals ( "creative", "c" )) {
It errors and says, ''equals(java.lang.Object)' in 'java.lang.String' cannot be applied to '(java.lang.String, java.lang.String)''
When I remove the comma it says, "',' or ')' expected"
you can ofc only have one argument in the equals() method
you'd have to do it like this:
if(usage.equals("creative") || usage.equals("c")) {
ah, thanks mate
np
👍 no errors 😄
that sounds so british
I'm so british, I drank a tea today
May I have a bottow o wata
I read words aloudin my head
lmao
Sure
dm me
lol
wtf I never noticed this feature
I also never understood the purpose of this menu item
I mean it's even empty
nothing happens when you click on it
Depends on which bots are installed on the server
Because no discord bots in that server have context menu
Some bots have app integrations
Here in my friends server we have a few more apps
Which none of us use, but uh... they're there!
yeah but why do they show it when it's empty
No idea :D
weird 😄
damn that's nice
I'll have to check whether JDA supports this
it probably does, JDA is awesome
It does
Multiple occurrences of 'usage.equals("creative") |'| usage.equals("c") || usage.equals("1")'
cool
Probably wants you to use a Set instead
Here, i'll send the whole file
ignore the command importing I have that under control
you have duplicatews of the same line
Condition 'usage.equals("spectator") || usage.equals("sp") || usage.equals("4")' is always 'false'
Condition 'usage.equals("spectator") || usage.equals("sp") || usage.equals("4")' is always 'false'
apart from that the code is still a bit questionable lol
@subtle folio was helping me but they had to go to bed
final Player other = Bukkit.getPlayer(args[1]);
sender.sendMessage ( translateColor ("&e&lYou set" + other + "&e&l's gamemode to &e&lADVENTURE " ) );```
you probably wanna use other.getName()
Fun little thing people never seem to take advantage of, you can create multiple instances of your executors with varying constructor arguments to accomplish similar command logic. As an example, I have a local plugin because I dislike using Essentials on a testing server (it's overkill af and I hate the things that Essentials does), and I do this for my gamemode commands,
this.registerCommandSafely("gms", new CommandChangeGamemode(GameMode.SURVIVAL));
this.registerCommandSafely("gmc", new CommandChangeGamemode(GameMode.CREATIVE));
this.registerCommandSafely("gmsp", new CommandChangeGamemode(GameMode.SPECTATOR));
this.registerCommandSafely("gma", new CommandChangeGamemode(GameMode.ADVENTURE));
I have one executor that accepts a GameMode argument
Runs the same code, different depending on the passed arg
private final GameMode gamemode;
public CommandChangeGamemode(GameMode gamemode) {
this.gamemode = gamemode;
}
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player player)) {
sender.sendMessage("Only players may use this command");
return true;
}
player.setGameMode(gamemode);
player.sendMessage("Your gamemode has been set to " + ChatColor.YELLOW + gamemode.name().toLowerCase().replace('_', ' ') + ChatColor.RESET + ".");
return true;
}```
My command is extremely simple as a result and reusable
Albeit not 100% applicable to your snippet above, Ethan, but you can add to that executor so that your code will support player args and whatnot :)
I just chose not to because it's my own plugin for my own test server, I really have no reason to do it
I saw that there is a way to have the plugin code in a separate backend and when the server turned on, it connected to that backend and the plugin worked normally, does anyone have any documentation on this? Basically it would serve to prevent leaks
ACF be like this 😛
that's not allowed for paid plugins on spigotMC
hello purple, my love
Also, I doubt it would prevent leaks unless it just does calculations and loads nothing from backend to frontend
if you know what I mean
hi mfnalex ❤️
ily
❤️
only a bit
ah
yeah and now my back hurts
rippp
I ate really much, then felt sleepy lol
story of my life
and then there's verano
lmaooo
I don't think so, it was mostly cheese lol
gouda, IIRC?
it is ❤️ the dutch people know exactly how to do three things:
- weed
- cheese
- running over people with their bicycles
LOL
netherlands is just the country of bikes
no cap
at least that's what I heard
damn
in my city, we have 300k people but over a million bicycles
why so many bikes 😭
idk haha
omg
1.05 million bikes for 300k people
wtf
yeah I also don't understand it
3.5 bikes for each person!
What the fuck
opinion on electric bikes?
they are nice, but unfortunately they are considered "actual vehicles" so you must not be too drunk when driving them
it's better than a fucking apple store 😭
the usual limit for riding a bike is 1.6‰ but for electric ones it's only 0.5 ‰ (same as for cars)
ah
0.5‰ is 0.05%
yeah it's "permille" and not "percent"
ah
we basically only use this to measure alcohol blood content
oh?
maybe some scientists also use it but no idea, I am not a scientist 😄
but ur a nerd
me neither! 😄
idk how people get offended by being called a "nerd"
just take it as a compliment lol
yeah well it depends on how someone says it
eh fairsd
if someone says "you fucking nerd" then I guess they didnt mean it very friendly 😄
your a fucking nerd
<3
see? you added the heart for clarification
because you noticed that otherwise it sounds unfriendly
lol
you're* 
LOL
Purple
hi dessie
L

your so stupid, I will tell you're mom about it
sorry bae
scnr
my friend dms me ur a fucking c"un" t all the time and always puts a heart after it xD
fairs
haha I also do that with @Cazcez
oh he left this discord
what a jerk
insulting someone your friends with is proof your friendship is amazing
lemme find some dms with my friends
I don't know if my bf would allow this, but we could say "it's only for tax purposes"
that's actually how my mom proposed to my father
she was like "why don't we marry, it would save us so much taxes" or sth like that haha
and then they married
42 years ago
nvm I only say owo or call my friends "lazy fuck"
and now they got me, a weird gay son who codes minecraft plugins for a living and is drunk all the time. WAS THIS REALLY WORTH IT???
TL;DR they think the same haha
I love my parents
but I guess most people do
OR DO YOU NOT LOVE MY FATHER?!
found some LOL
L = loser
Can someone help me by using intellij code with me?
what ?
The thing I'm trying to fix is to complicated to explain
¯_(ツ)_/¯
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
There is no way it's too complicated just get good at java or asking questions
@EventHandler
public void onGoldenAppleEat(PlayerItemConsumeEvent event) {
if (event.getItem().getType() == Material.GOLDEN_APPLE) {
getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
getServer().sendMessage(Component.text("Chest Opened GREEN"));
}
}, 20L);
}
}
Anyone know why this won't work?
It isn't returning any errors
plugin is justSumowars plugin;
actually
nevermind
plugin is null
Add debugs at the first if statement if it still isn't hit likely not registered as a listener
💀
https://paste.md-5.net/tiqewacavo.cs
What i'm trying to do is for the following commands:
/gamemode || gm <gamemode>
I dont want console to be able to do it BUT if console specifies a player I want it to be able to
Just check if sender is console for the arg containing a player using instanceof.
Also don't just blind cast ¯_(ツ)_/¯
Tbf to him that question was hyper complex 😂
my parents are uhhhh.. somewhat unhappy about my job
I guess I actually came up to their expectations slightly
what is your job
plugin dev
First it was: Nah he isn't making money, it must come from drugs
Then it was: He's using drugs, and hacking into banks at night
Then it was: He's a useless piece of shit, but he isn't doing drugs
and now it just is: Dude's playing games all day, his money must come from somewhere else
LOL
I used to skip class because I'd stay up all night coding
Just give your job a cooler title.
and teachers thought I was a thug
my parents actually understand the process of how I make my money because they asked how I do it and whatever
it's like they're interested in how it all works
Clustered infrastructure and microsystem engineer
nowadays if anyone asks I just say "I'm a game developer - I make content and events for videogames and youtubers"
I'm doing games dev in college, so I can actually say that 😭
I mean
I'm currently making a mix of Google Classroom and Discord within minecraft
so idk how to describe it
fuck I start school in 4 hours
I write bots to collect data for cryptocurrencies
Software and Data analyst with a specialization in blockchain technology
WOO UK CITIZEN
spain?
still an hour ahead
ye
different timezones or some shit idk I'm not international
well in theory I am
It's hot as shit in my room but if I open my window, I'll let noise out
turning on the AC will also make noise
grr
do u have a fan
12 degrees outside rn 🤤
no
haha ur fucked
I know
31C in my room, 24C outside
31 inside? Sheeeeesh
doesn't help that I live in a tropical city like 2km away from the beach
I wanna move to canada to experience real cold for the first time
mf we got 15C winters and 40C summers here
where's the fun in that
mfs dont even buy coats here
-40C I'll trade you for the 15C winters tbh
people here are doing excursions to see snow
with cold you can always add more layers
but you can't take your skin off during the summer
You don't want it to be super cold trust me
at least experience it once yk
life is mundane if the only difference between winter and summer
is that during winter, the sun sets at 5pm
and during summer, the sun sets at 9:30pm
you're still dying of heat
I guess
there's an ice shortage across the country
Tf ice shortage
noone can help you if you dont explain it
Idk where you from but we make our own ice wt my house
I mean yeah but good luck cooling yourself down with 8 cubes / day
Look when he properly asked it was not complex at all laughed my ass off
quick design question
Oh we have an ice maker at my house
how tf should I make an influxdb wrapper
I want to make an easy metrics api that I can just push stuff instead of pull every <x> time
oh I havent seen. I was busy on other discords 😄
I could make a metrics object, maybe a metrics.push("online-players", 10) ?
It was legit bout checking whether sender was console or player for certain args
wtf
Guys can anyone help me?
I wanted an item to sell at chestshop
however this item is a feather enchanted with an enchantment that does not exist.
Basically I enchanted her to make the Players fly.
and I want them to sell automatically.
Is there a way to have 1.16.5 Forge with Bungee? Any fork I can use?
Magma | paper + forge
Could you elaborate?
What do you mean by "enchantment that does not exist"
and who is her?
This is the item, it's a feather
only it was enchanted to send commands when the player presses it
however despite her being enchanted she is not a registered item with enchantment, she is still just a feather.
Then my question would be if it is possible to register this item the way it is somehow
did you understand?
what do u want to do?
i cant understand a shit
make the item like in use
or afteruse?
and change item data
sorry, its all google translate kkkk
lol wait
i understand
u want on use
item > Bye
just set item to air on player hand
on interact using the item
thats it
and add him to an map for 10 min of fly
and afterwards it remove
this I already made happen
what i want now, is to make the id of this item change
so I can put it in the store to be sold
replace item in hand
u cant really change the self item
just replace it
user wont notice even
i would suggest you either to learn some enlgish basics
english*
like i have no idea how you code something
coding isnt in spanish
kkkkkkk
i will learn
one day
the modification of the id
is made with plugin
or with normal command?
of minecraft
I couldn't find it, is it even possible to change the item ID?
Hi a question how can I create a global variable, I mean for example {player} that use that in the config.yml and that is replaced by the name of the player that if I know how to do it but is there a way to not have to write all the lines in each command? I don't know if you understand me, sorry I'm just starting in this
that's... called a placeholder
and you need to write code for that unfortunately
easiest way I do it is just to have a placeholder registry
or just hook into papi and parse placeholders on the moment
Emm thanks ig
And if I try to create my own API it will not work?
it will
I have my own placeholder code
Just go the easy way and make a basic message system
that's like
public void sendMessage(CommandSender sender, String idInConfig, Function<String, String>... args)
or something
or have a set of placeholders idk
then you'd just
sendMessage(player, "no-permission", (text) -> text.replace("%permission%", "123.456.something"));
Ohh ok thanks 
That's what I have, at least
insert
how do I use mvn deploy to upload to an SFTP server?
i mean, I managed to set it up but it says Algorithm negotiation fail
maybe use it in ur own server
instead
during testing
or do it manually
i always put my plugins manually
no issues
i dont see a reason using sftp
run test server from your own computer
not from 3rd party virtual box
or what ever you consider a server
or use jenkins or some other ci server
jankins
Can some someone explain this to me ?
It happend when I send a text component to someone
is this true? if 2 plugin use same command
hi guys so use entity uuid
to modify it
in general
the question is
how to check if its dead or alive?
not really in general
there will be still /plugin1:command /plugin2:command
but lasted plugin will overide all of them
so
because it was last registered >
there many ways
u can use entity#set
._.
can you send one?
its mainly used for hex
"#ff0000" will give bleeding red
didnt work
setType
change the itemstack
its for zombie
it works 100%
i just tested rn
Entity#getEquipment#get%PART%.setType(itemstack)
@Override
public boolean onCommand (CommandSender sender, Command command, String label, String[] args) {
if (command.getName().equalsIgnoreCase("skeletonb")) {
if (sender instanceof Player) {
Player p = (Player) sender;
p.sendMessage(ChatColor.GREEN + "This command works, " + p.getDisplayName() + "!");
Location targetlocation = p.getLocation();
Entity boss = p.getWorld().spawnEntity(targetlocation, EntityType.SKELETON);
boss.setCustomName("Hello");
boss.getEquipment.getBoots().setType(itemstack);
}
}
return true;
}
thats my code
@boreal seal
as a friend
try boss.getEquipment.setBoots(ItemStack item);
i would suggest you try mythicmobs
its what i told him
a min ago
itemstack should bean item
and customname should be an armorstand
so it will always display
That is what he did "boss.getEquipment.getBoots().setType(itemstack);"
getequipment doesnt even work
try MythicMobs
How can I get EnderChest from PlayerInteractEvent?
u r new to coding
boss.getEquipment.getBoots().setType(itemstack); can result in NPE
how can i
check wether entity is dead or alive
using entity uuid?
get the entity from Bukkit ig
i went thru docs
and check if it's dead
I did this. but Its not working
It should work.
"boss.getEquipment.setBoots(ItemStack item);" getEquipment wont do the thing
Why ?
idk
Did u test it ?
no image perms
have u checked if item is null ?
@lean sandal hello
dwnfjhesfbh
fixed my code, changed:
- Entity boss = p.getWorld().spawnEntity(targetlocation, EntityType.SKELETON);
to: - Skeleton boss = p.getWorld().spawn(targetlocation, Skeleton.class);
Someone ?
make sure there is no change to storage.increments and storage.decrements while it is looping over them
also HoverEvent is shown deprecated here
i'm using the old constructor
Well it is deprecated, might be the issue, might not
There's no change
No thread issues could happen?
if i sent packet
all players achieve it right
like particle paccket
so i need to target only players near the location true?
to sent the packet
to not flow their net
It's something happening while sending the text component
I didn't find any thread talking about this issue
What if increments and decrements are both empty?
https://paste.md-5.net/olumanefax.sql im keep getting this, can someone take a look please?
What should i do
maybe, I just want to know the cause of this error
seems like an infinite recusion
show your code
make sure they are not null
or empty
its a plugin called PlayTime
They aren't null, but could be empty
btw a hover event can be empty ?
well you would need to look at the code for the sender then
maybe it assumes the passed thing has a length > 0
alright i'll check if they are empty
yep
go up literally 2 lines
hehe
why is ur profile so bright wtf
Is it possible to get Enderchest from PlayerInteractEvent?
how?
You listen to the PlayerInteractEvent and check if an enderchest was clicked...
EnderChest is the BlockState of that block
Do you want to get the ender chest inventory or do you want to get the BlockState?
BlockState
isnt it tile state?
EnderChest chest = (EnderChest) event.getClickedBlock().getState();
Thanks
what is libraries in plugin.yml and how to use it?
https://www.spigotmc.org/wiki/plugin-yml/ But spigot is down now
Could you help me guys with my cooldown?
```java
if(System.currentTimeMillis() - cooldown.getOrDefault(player.getUniqueId(), System.currentTimeMillis()-50) > 50) {
if (actualAge.get() - 1 >= minAge) {
actualAge.getAndDecrement();
furnaceGui.setActualAge(actualAge.get());
cooldown.put(player.getUniqueId(), System.currentTimeMillis());```
It doesn't work...
Its in beta
uh ok
The libraries section is a list of maven dependencies that will be downloaded at runtime.
The format is:
libraries:
- "<groupId>:<artifactId>:<version>"
Not really
thanks
Last time I checked it was in beta :/
cooldown.put(player.getUniqueId(), System.currentTimeMillis());
You are missing a delta here
a what?
Whats up with your 50ms offset?
Ah this explains it. sarcastic voice
Simply, it stops there
if(System.currentTimeMillis() - cooldown.getOrDefault(player.getUniqueId(), System.currentTimeMillis()-50) > 50) {
The system works, put the cooldown, it doesn't get to add or remove
long now = System.currentTimeMillis();
long coolDownEnd = cooldown.getOrDefault(player.getUniqueId(), now);
if(now >= cooldownEnd) {
// Cooldown has ended
}
Then for setting a cooldown:
long now = System.currentTimeMillis();
long cooldownMs = 500;
cooldown.set(playerId, now + cooldownMs);
ouh! Thank you
Take it slow and create a lot of variables with descriptive names. Makes logic easier to untangle.
works good!
[15:24:56 INFO]: Downloading https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.pom
[15:24:57 INFO]: Downloading https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom
[15:24:57 INFO]: Downloading https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom
[15:24:58 INFO]: Downloading https://repo.maven.apache.org/maven2/org/junit/junit-bom/5.7.2/junit-bom-5.7.2.pom
[15:24:58 INFO]: [BlockPortals] Loaded library D:\servers\testfarms_1.18\libraries\commons-io\commons-io\2.11.0\commons-io-2.11.0.jar
how can I equip an armorstand head slot via protocollib?
I know its PacketType.Play.Server.ENTITY_EQUIPMENT, but how to use it?
ew protocol lib
ClientboundSetEquipmentPacket(entity id, List<Pair<EquipmentSlot, ItemStack>>)
if you chose to use moj mappings
PacketContainer container = new PacketContainer(PacketType.Play.Server.ENTITY_EQUIPMENT);
StructureModifier<List<Pair<EnumWrappers.ItemSlot, ItemStack>>> equipmentMod = container.getSlotStackPairLists();
List<Pair<EnumWrappers.ItemSlot, ItemStack>> equipment = new ArrayList<>();
// Fill list here
equipmentMod.write(0, equipment);
StructureModifier<Integer> idMod = container.getIntegers();
int armorStandId = ...;
idMod.write(0, idMod);
ProtocolLibrary.getProtocolManager().sendServerPacket(player, container);
*Didnt test
Taking a look at the nms packet is often helpful
Guys, i'm a little bit stuck/fried.
I have this method in another class file
public static void equip(PlayerInventory inventory)
And i'm trying to use it in another command file like so
t.getInventory().addItem(kit.equip());
However there is an error - The method equip(PlayerInventory) in the type KingKit is not applicable for the arguments ()
Would you mind giving me some help because I can't figure it out.
What are you trying to do
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
You are pssing a method as a value
Also its a static method call on an instanced object + the method has parameter requirements but he is not
passing any. This is a clear case of not learning the very very basics of the language.
worked, thx
Does anyone know how to fix this ?
Any exceptions in console?
nah just this
What version are you using?
1.8.8
When I send a text component to a player this happend
ikr
code
Nope
no getType*
block.getType() == Material.SOMETHING
whats the difference between .equals(9;
You can use == because Material is an enum
ah ok thanks
.equals() checks if the objects looks equal (checking for properties like x, y, z)
and == checks for identity, meaning if both objects are the same (equal memory address)
hello, do you know a way to stock data on a player without any file or database pls ? (like persistentDataContainer but for 1.8 mc)
like an api or something like this ?
pdc
1.8 support was dropped years ago. Leave that ancient version to die already.
That being said: There is NBTAPI which should suit you.
how to set the yaw on an protocollib tp packet? I got it working without yaw, but it seems like you cant set the yaw vector
PacketContainer teleport = new PacketContainer(PacketType.Play.Server.ENTITY_TELEPORT);
teleport.getIntegers().write(0, entityID);
teleport.getDoubles().write(0, entityLocation.getX());
teleport.getDoubles().write(1, entityLocation.getY());
teleport.getDoubles().write(2, entityLocation.getZ());
teleport.getVectors().write(0, yawVector);
// SENDING PACKET HERE
Yaw is not a vector. Its a horizontal rotation. A single float number representing the angle.
oh ok thx
okokthx
Hey!
how can i check Critical Damage on event ?
so a single use event?
why would you? to save yourself a few characters of typing?
make a macro xD
you gotta be kidding hahaha
anyone know how should i make clock?
basically: 1 day = 20 minuted(24k ticks?)
31 days = 1 month
12 months = 1 year
should i use runTaskTimer? or what
no, you should take the current world's time and just divide it through 20000 or whatever it is
well thats smart
a timer seems a bit overkill for this imho
?paste
did you access ItemsAdder in your plugin?
Yes, i am creating items
show your code pls
wait lemme
it looks like you try to access ItemsAdder before it got enabled or sth
did you add ItemsAdder as "depend" in your plugin.yml?
do i have to?
i am using api
usually, yes
try to do it like this in plugin.yml
depend:
- ItemsAdder
i have 16gb ram. 8 in using it should use %50 of ram but
it uses %83 and i cant do anything
Isn't that saying its using 83% of 8 gig?
no, it means "berat" is using 7300MB and in total, the system uses 83% of the whole 16 GB
ah ok
I use Win7 so it's a very different display
konsolunu atar mısın?
you should really use english variable and method names, otherwise it's extremely hard for us to understand D:
english only here 😛
especially if its turkish
I know a bit of turkish but not enough to understand those method names 😄
you always want to keep code in english
i gave minecraft 1024 mb and waiting it for 15 minutes to open
anyway, do you actually ever call the init() method?
have you called the constructor somewhere?
your constructor definitely does NOT call init()
"hiz" is probably always null
tamam
haha
as said, I know A FEW words
oh you should maybe also just add some System.out.println() to each method so you can see whether they actually got called
then add debug messages to every method call
and then see what methods get called
pls show the code where you open the inventory
I see, you open the same inventory every time
you should always create a fresh inventory
otherwise it will be empty after it was opened the first time, if someone takes out all the items
sure
usually you have a method like createGui() which creates a totally new inventory from scratch and returns it
reusing the same inv all the time will cause problems
why does this happen?
runes:
'1663592935853':
statistics.1:
it is supposed to be:
runes:
'1663592935853':
statistics:
1:
code:
@NotNull
@Override
public Map<String, Object> serialize() {
Map<String, Object> map = new HashMap<>();
for (RuneStatistic statistic : statistics) {
map.put("statistics." + statistic.getId(), statistic);
}
// some other stuff
return map;
}
i thought of turning id into a string, but i didn't need to do it at the '1663592935853' part
What's up ⬆️ gamers 🎮 It's me 🧑🦲 it's ya boy magmaguy 😎 back with another fire 🔥 question ❓
What's the first 🥇 Minecraft ⛏️ version that supported java ☕ 16?
;-;
I'm hip and cool and definitely not balding
oh boy
ballers not balders amirite
1.16 iirc
lit 🔥 fam 🤝 thanks 💾
This isn't the right channel.
Didn't Ask + Cope
Lol 10 yo spotted
it really isn't
gee I wonder why I might've asked
Google exists too.
🥲
It's not hard to google "which minecraft version supported Java 16 first?"
https://sourceb.in/0v9NY4BuB8 Hi im getting this error java.util.NoSuchElementException: No value present
It's ok magma guy even those these clowns don't love you I do <3
I'm trying to figure out how to get if the player is blocking with a shield and if the player attacking them isn't in the direction where the shield can block damage.
What's up ⬆️ gamers 🎮 It's me 🧑🦲 it's ya boy tony magma the boy 😎 back with another fire 🔥 question ❓
What's the first 🥇 Minecraft ⛏️ version that supported java ☕ 4?




no its tottaly legal
you'll be hearing from my lawyers
I tho8ght you were magma
oh so that's why it's yellow
i hope coco dont read it
I always wondered
The value you are looking for in ur list / map / array doesn't exist
but its for the itemstack or for the array?
Whatever your fetching it from doesn't contain that element your looking for
Thus the exception
so that's interesting
Your interesting
1.16.5 was still on java 8 which seems to be congruent with my preliminary testing but papermc seems to run just fine with java 16 on 1.16.5? Does anyone remember the ancient lore and if paper was supporting a broader range of java versions?
Paper lore
I must consult the ancient scrolls
Is it possible to detect if the player is blocking with a shield and is facing towards the attacker?
yes
How would I go about doing so?
I'd tell you but I'm deathly afraid that I will be told that I am misusing this room once again
but hey, google exists!
I already tried looking it up smh
Why would that be misusing this room?
I am just copy pasting what he told me a few minutes ago
I see
MagmaGuy — Today at 14:19
What's up ⬆️ gamers 🎮 It's me 🧑🦲 it's ya boy magmaguy 😎 back with another fire 🔥 question ❓
What's the first 🥇 Minecraft ⛏️ version that supported java ☕ 16?
ZBLL — Today at 14:19
;-;
MagmaGuy — Today at 14:19
I'm hip and cool and definitely not balding
ZBLL — Today at 14:20
oh boy
MagmaGuy — Today at 14:20
ballers not balders amirite
Y2K_ — Today at 14:21
1.16 iirc
MagmaGuy — Today at 14:22
lit 🔥 fam 🤝 thanks 💾
SomeoneOnDlscord — Today at 14:23
This isn't the right channel.
Y2K_ — Today at 14:23
Shut up
That's a valid dev question clown
SomeoneOnDlscord — Today at 14:24
Didn't Ask + Cope
Y2K_ — Today at 14:24
Lol 10 yo spotted
ZBLL — Today at 14:24
it really isn't```
I'd send a screenshot but it won't let me, probably because I'm not verified.
I just came here to ask about properly detecting shield blocking so that if the player is hit from behind while blocking, they will take damage.
Yes you need to be verified in order to send images.
However, I'm not here to judge anyone since that's not what this channel was made for.
If he didn't like how you responded it's up to him whether he wants to help you or not.
man could've used the player#isBlocking() combined with either a damage event or a repeating task and then scanned the world for players and used some basic vector math to figure out if they were within a certain amplitude but instead he just had to tell me I was misusing the room and then ragequit from the karma
smh
uh
scheduleWithFixedDelay in scheduled executor service
runs off thread right?
is there a way to make it run on the main thread
i have to schedule something to happen every few moments but
Not with a fixed delay I guess. Since fixed delay might be inbetween ticks
implement some kind of lock to make it safe
i mean i think it should be safe
since what it does is to send packets
to a server
thats all
you can send packets any time you like. they are queued
@tender shard i handled the error
https://paste.md-5.net/vajohihocu.cpp i am using this but i cant see items on inventory
.getFloat().write(0, (float) yawVector.getX()) is also throwing an FieldAccessException: Field index 0 is out of bounds for length 0
its not a float, its a byte iirc
error
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\user\Desktop\plugins\horses). Please verify you invoked Maven from the correct directory. -> [Help 1] But it is in the folder so I really don't get it
It also may be that file is not present on your branch if using intellij and have github connected
how can I calculate the yaw for an protocollib armorstand to look at an location?
how do I change the chat format?
?paste
AsyncPlayerChatEvent -> #setFormat(...)
ok thx
it expects a string like in String.format
first %s is the username, second %s is the message
Hello How can I add getConfig() in another class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Like that
Ok thx
I have this error ...
org.bukkit.command.CommandException: Unhandled exception executing command 'maintenance' in plugin ShinobiCraftPlugin v1.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[PluginCommand.class:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:156) ~[SimpleCommandMap.class:?]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:752) ~[CraftServer.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:1590) ~[pa.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:1429) ~[pa.class:?]
at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:46) ~[la.class:?]
at net.minecraft.network.play.client.CPacketChatMessage.func_148833_a(CPacketChatMessage.java:9) ~[la.class:?]
at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:16) ~[hv.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_202]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_202]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:840) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:461) [nz.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:778) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:624) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_202]
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at fr.spectr2155e.shinobicraft.commands.Maintenance.onCommand(Maintenance.java:23) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:43) ~[PluginCommand.class:?]```
What is line 23 in Maintenance
cannot wait for the args[0]
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ok
you probably do if(args[0].equalsIgnoreCase("something")) without checking if args even has at least 1 element
^
public void onDeath(PlayerDeathEvent player) {
if (player.getEntity().getMaxHealth() > 1) {
player.getEntity().getKiller().getMaxHealth() += 1;
}
}
}```
Need help, im trying to make it so it removes 1 max health from player taht dies and add 1 to player that kills
I get an error
unexpected type: get.maxhealth()
You can't add to a method return like that
You can't set a player max healt as you did
You need to use Attributes ^
There is a method for that
?paste
.setMaxHealth() I think
https://paste.md-5.net/eguqusoqat.cs Can someone take a look at this
Yeah, but it's deprecated in favor of Attributes
That is a lovely NPE yes
No idea im new to this
In 1.12.2 I guess it's still with methods
method setMaxHealth in interface org.bukkit.entity.Damageable cannot be applied to given types;```
What version are you using?
Oh maybe in 1.12.2
I use latest
1.18
Yeah use Attributes then
@hasty prawn it's yours
public static CustomStack setMeta(String displayName, CustomStack custom_stack, ItemMeta meta, int pdcValue, String name){
custom_stack = CustomStack.getInstance(name);
meta = custom_stack.getItemStack().getItemMeta();
meta.getPersistentDataContainer().set(Keys.smithingItems, PersistentDataType.INTEGER, pdcValue);
custom_stack.getItemStack().setItemMeta(meta);
meta.setDisplayName(displayName);
return custom_stack;
}```I am using this to save itemstacks but it says custom_stack is null
Where are you calling that? Whatever you're passing as custom_stack is null
How would i do atributes then? 🙂
Maybe an item has no item meta
the line where i check if player has more than 1 health gets the same error btw
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
man i will kill myself
i just forgot to define those
private static CustomStack itemSadderSwordGui;
private static ItemMeta itemSadderSwordGuiMeta;
private static CustomStack itemSadderPickaxeGui;
private static ItemMeta itemSadderPickaxeGuiMeta;
private static CustomStack itemSadderAxeGui;
private static ItemMeta itemSadderAxeGuiMeta;```
if(e.getClickedInventory().getHolder() instanceof bmUi){
e.setCancelled(true);
switch (e.getSlot()){
case 2: {
p.closeInventory();
ItemStack item = e.getCurrentItem();
ItemMeta meta = item.getItemMeta();
String itemlore = meta.getLore().get(0).split("$")[1];
getLogger().info("[clans] the price selected is: " + itemlore);
int price = Integer.parseInt(itemlore);
EconomyResponse response = economy.withdrawPlayer(p, price);
if(!response.transactionSuccess()){
p.sendMessage(ChatColor.BOLD + "" + ChatColor.RED + "you cannot purchase this item");
} else {
p.sendMessage("you bought this item !");
item.setItemMeta(null);
p.getInventory().addItem(item);
}
error: Could not pass event InventoryClickEvent to Clans v1.0 java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1 at net.polarlabs.events.clickEvent.onClick(clickEvent.java:37) ~[?:?]
gui presented in the screenshot
Send line 37
String itemlore = meta.getLore().get(0).split("$")[1];
String#split accepts regex and $ is a regex character. You have to escape it. split("\\$")
ah okay.. Ill give that a go and recompile
man actually no
i dont need to define them
NEWGUI.smithChooseGUI.setItem(21, setMeta(ChatColor.RED + "Kılıçlar", itemSadderSwordGui, itemSadderSwordGuiMeta, 501, "itemsadder:ruby_sword").getItemStack());
yes i am using setMeta(); to define it
public static CustomStack setMeta(String displayName, CustomStack custom_stack, ItemMeta meta, int pdcValue, String name) {
custom_stack = CustomStack.getInstance(name);
meta = custom_stack.getItemStack().getItemMeta();
meta.getPersistentDataContainer().set(Keys.smithingItems, PersistentDataType.INTEGER, pdcValue);
custom_stack.getItemStack().setItemMeta(meta);
meta.setDisplayName(displayName);
return custom_stack;
}```
What does CustomStack.getInstance() return?
Btw why are you passing custom_stack in args, then immediately give it new value
@Nullable
public static CustomStack getInstance(String namespacedID) {
throw new NotActuallyItemsAdderException();
}```
Okay so custom_stack isn't ever getting set to anything
Which means it's still the null value you passed in
wtf
Why you made it like that lol
Oh
Who in the world made it
to give a specified namespacedkey
api damaged or 😃 ?
noobs where
where is every
I still don't get the sense of a static method called "getInstance" that throws an exception
every where
I dont either
kinda gay getter then
it shouldnt be like that
maybe throws nullpointer cuz dev forgot to initialize instance field
I tried to give it to my hand directly and it just gave
It's neither a NullPointerException
Send the API docs
?
I am asking them for help
and their fucking discord server has full of plugins i am trying to deal with
my younger brother has internet lesson in another room
and i'm stuck in a toilet with no toilet paper
can't ask him to bring me a roll
ez
tf am i lookign at
trashcode?
oh i see
BungeeCord Question:
Does ServerConnectedEvent called only once when their login (and verification which they are signed in) was completed? (docs are kinda confused)
he just hid it
then make it an interface lol
¯_(ツ)_/¯
a lot of plugins and apps written on java have this thing
with hidden implementation
on github
how can i cancel a bukkitrunnable outside the runnable?
umm
store it's id, get it by id when needed
or store the runnable object to a variable
and call .cancel() when needed
k thx
💀
What is this
some shitty plugin that i saved in my bookmarks for whatever reason
Error 404: naming conventions not fond
wtf
Anyone know how to cancel a players death event?
Listen to the damage event and cancel that if the damage would kill the player
player.getHealth() <= event.getFinalDamage()
Something like this?
Yeah
Okay so why isn't it working?
How do I calculate an arrow's damage based on it's velocity? I'm recoding the entirety of damage, knockback, etc. I'm curious as to what the equation for arrow damage is. I know it's based on velocity/how much the bow was pulled back, but without using event.getFinalDamage() or event.getDamage() in EntityDamageEvent.
Who knows 🤷♂️
We have no information to work with
what is it's name
varargs
well you can basically get the highest velocity by testing full charged bow
or look at nms code
ah so the max velocity is 6 damage, and if its lower than divide? wouldnt the velocity be different depending where the player is standing and whatnot?
public void Death(EntityDamageEvent event) {
Player player;
String playerName;
List<String> names = plugin.getConfig().getStringList("immortals");
if(event.getEntity() instanceof Player) {
player = (Player) event.getEntity();
playerName = player.getName();
for (String name : names) {
if (name == playerName && player.getHealth() <= event.getFinalDamage()) {
if (player.getBedSpawnLocation() != null) {
player.teleport(player.getBedSpawnLocation());
player.setHealth(player.getMaxHealth());
player.setFoodLevel(player.getFoodLevel());
event.setCancelled(true);
}else {
player.teleport(player.getLocation().getWorld().getSpawnLocation());
}
player.sendMessage("Death shall not come for you yet, my friend.");
}
player.sendMessage("Goodbye");
}
}
}```
i found a basic equation for knockback luckily:
t.setVelocity(arrow.getVelocity().setY(0).normalize().multiply(0.47 + new Random().nextDouble() / 70 + arrow.getKnockbackStrength() / 1.42).setY(0.400023));
don't compare strings with ==
that's the problem
not the final damage part
weird ahh
Ah thanks, I always forget that.
also when player's bed location is null he is gonna die
cuz you didn't cancel the event when it is
Oh lol
you can make your code like 2 times smaller
i have a problem. when i issue a command it works but im getting this message: An internal error occurred while attempting to perform this command
umm
i mean all works how it should but i become this
no lol
You should see the rest of the plugin lol. Optimization is not my goal.
then you might have two plugins do the same command
trashcode is trashcode)
that's why
FREE JAVA LESSONS
(checkmybio)
No
umm feels bad
what is server version you code for
1.19, and it works now. Thanks
myes naming conventions gone
ye
yup I see what was going wrong now, thanks !
oh hi fourteen
hi
or just separate words by . or , instead
teacher stopped lesson hour earlier lol
@EventHandler
public void onLethalDamage(EntityDamageEvent event) {
if(!(event.getEntity() instanceof Player player)) return;
if (player.getHealth() > event.getFinalDamage()) return;
if (!plugin.getConfig().getStringList("immortals").contains(player.getName())) {
player.sendMessage("Goodbye");
return;
}
Location bed = player.getBedSpawnLocation();
player.teleport(bed == null ? player.getLocation().getWorld().getSpawnLocation() : bed);
player.setHealth(player.getMaxHealth());
player.setFoodLevel(player.getFoodLevel());
event.setCancelled(true);
player.sendMessage("Death shall not come for you yet, my friend.");
}
if(p.getInventory().getItemInOffHand().getType().equals(Material.TOTEM_OF_UNDYING)) {
//Delete Item in offhand
}else if(p.getInventory().getItemInMainHand().getType().equals(Material.TOTEM_OF_UNDYING)) {
//Delete Item in mainhand
}```
Trying to make it delete the totem in the offhand (dont ask why)
Not sure what the line of code would be to remove an item tbh.
just setItemInOffHand to air or null
you also have to check if it's not null btw
ty ❤️
ItemStack main = p.getInventory().getItemInMainHand(), off = p.getInventory().getItemInOffHand();
if(main != null && main.getType().equals(Material.TOTEM_OF_UNDYING)) {
} else if(off != null && off.getType().equals(Material.TOTEM_OF_UNDYING)) {
}```
Is there any way to not network a PDC so clients with mods like NBTToolTip cant see it? I dont see why it’s networked
Anyone know how many particles I need to spawn to make it look like someone just used an enderpearl?
on items ?
not really
Yeah I wanted to be able to differentiate things serverside completely invisibly to client
Well
you can always just only add a uuid
and then resolve all data server side
you will never be able to do stuff completely invisible
else the client would believe item stack a is item stack b
eventho they have different PDC
and shit explodes
its technicallyyyyy possible (maybe)
but not really for a plugin
would be spigots job somewhere in the future
Yeah it was unstackables at least so won’t be a huge issue
Won’t stick out if they did or did not which is one issue


